Update contrib.
3 * Portions Copyright (c) 1993-2005 Nokia Corporation and/or its subsidiary(-ies).
8 /* @(#)s_ldexp.c 5.1 93/09/24 */
10 * ====================================================
11 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
13 * Developed at SunPro, a Sun Microsystems, Inc. business.
14 * Permission to use, copy, modify, and distribute this
15 * software is freely granted, provided that this notice
17 * ====================================================
22 <<ldexp>>, <<ldexpf>>---load exponent
31 double ldexp(double <[val]>, int <[exp]>);
32 float ldexpf(float <[val]>, int <[exp]>);
37 double ldexp(<[val]>, <[exp]>)
41 float ldexpf(<[val]>, <[exp]>)
47 <<ldexp>> calculates the value
49 <[val]> times 2 to the power <[exp]>.
54 <<ldexpf>> is identical, save that it takes and returns <<float>>
55 rather than <<double>> values.
58 <<ldexp>> returns the calculated value.
60 Underflow and overflow both set <<errno>> to <<ERANGE>>.
61 On underflow, <<ldexp>> and <<ldexpf>> return 0.0.
62 On overflow, <<ldexp>> returns plus or minus <<HUGE_VAL>>.
65 <<ldexp>> is ANSI, <<ldexpf>> is an extension.
73 Get floating-point value from mantissa and exponent.
74 Calculates the floating point value corresponding to
75 the given mantissa and exponent
76 @return Floating-point value equal to value * 2exp.
77 @param x Floating point value representing mantissa
78 @param exp Integer exponent
80 EXPORT_C double ldexp(double value, int exp) __SOFTFP
82 if(!finite(value)||value==0.0) return value;
83 value = scalbn(value,exp);
84 if(!finite(value)||value==0.0) errno = ERANGE;