1 2 /* @(#)s_ldexp.c 1.3 95/01/18 */ 3 /* 4 * ==================================================== 5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 6 * 7 * Developed at SunSoft, a Sun Microsystems, Inc. business. 8 * Permission to use, copy, modify, and distribute this 9 * software is freely granted, provided that this notice 10 * is preserved. 11 * ==================================================== 12 */ 13 14 #include "fdlibm.h" 15 #include <errno.h> 16 17 #ifdef __STDC__ ieee_ldexp(double value,int exp)18 double ieee_ldexp(double value, int exp) 19 #else 20 double ieee_ldexp(value, exp) 21 double value; int exp; 22 #endif 23 { 24 if(!ieee_finite(value)||value==0.0) return value; 25 value = ieee_scalbn(value,exp); 26 if(!ieee_finite(value)||value==0.0) errno = ERANGE; 27 return value; 28 } 29