support/fdlibm/s_ldexp.c
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 20 Feb 2013 23:05:49 +0000
branchdevelopment
changeset 2380 9195eccdcbd9
parent 1818 2e5ed72e7dfd
parent 2353 fa7400d022a0
permissions -rw-r--r--
Merged 08505399cea8 and 0adf7bbcf2c9 (branch default - CVS HEAD)


/* @(#)s_ldexp.c 1.3 95/01/18 */
/*
 * ====================================================
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
 *
 * Developed at SunSoft, a Sun Microsystems, Inc. business.
 * Permission to use, copy, modify, and distribute this
 * software is freely granted, provided that this notice 
 * is preserved.
 * ====================================================
 */

#include "fdlibm.h"
#include <errno.h>

#ifdef __STDC__
	double ldexp(double value, int exp)
#else
	double ldexp(value, exp)
	double value; int exp;
#endif
{
	if(!finite(value)||value==0.0) return value;
	value = scalbn(value,exp);
	if(!finite(value)||value==0.0) errno = ERANGE;
	return value;
}