1 /* @(#)s_scalbn.c 5.1 93/09/24 */ 2 /* 3 * ==================================================== 4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 * 6 * Developed at SunPro, a Sun Microsystems, Inc. business. 7 * Permission to use, copy, modify, and distribute this 8 * software is freely granted, provided that this notice 9 * is preserved. 10 * ==================================================== 11 */ 12 13 /* 14 * scalbn (double x, int n) 15 * scalbn(x,n) returns x* 2**n computed by exponent 16 * manipulation rather than by actually performing an 17 * exponentiation or a multiplication. 18 */ 19 20 /* LINTLIBRARY */ 21 22 #include <sys/cdefs.h> 23 #include <float.h> 24 #include <math.h> 25 26 double 27 scalbn (double x, int n) 28 { 29 return ldexp(x, n); 30 } 31 32 #if LDBL_MANT_DIG == 53 33 #ifdef lint 34 /* PROTOLIB1 */ 35 long double scalbnl(long double, int); 36 #else /* lint */ 37 __weak_alias(scalbnl, scalbn); 38 #endif /* lint */ 39 #endif /* LDBL_MANT_DIG == 53 */ 40