2 /* @(#)z_ldexpf.c 1.0 98/08/13 */
3 /******************************************************************
7 * d - a floating point value
8 * e - an exponent value
11 * A floating point value f such that f = d * 2 ^ e.
14 * This function creates a floating point number f such that
17 *****************************************************************/
23 #define FLOAT_EXP_OFFS 127
32 GET_FLOAT_WORD (wd
, d
);
34 /* Check for special values and then scale d by e. */
35 switch (numtestf (wd
))
49 exp
= (wd
& 0x7f800000) >> 23;
52 if (exp
> FLT_MAX_EXP
+ FLOAT_EXP_OFFS
)
57 else if (exp
< FLT_MIN_EXP
+ FLOAT_EXP_OFFS
)
66 SET_FLOAT_WORD (d
, wd
);
73 #ifdef _DOUBLE_IS_32BITS
75 double ldexp (double x
, int e
)
77 return (double) ldexpf ((float) x
, e
);
80 #endif /* defined(_DOUBLE_IS_32BITS) */