2 /* @(#)z_frexpf.c 1.0 98/08/13 */
3 /******************************************************************
7 * d - floating point value
11 * A floating point value in the range [0.5, 1).
14 * This routine breaks a floating point value into a number f and
15 * an exponent exp such that d = f * 2 ^ exp.
17 *****************************************************************/
22 float frexpf (float d
, int *exp
)
27 /* Check for special values. */
38 GET_FLOAT_WORD (wd
, d
);
40 /* Get the exponent. */
41 *exp
= ((wd
& 0x7f800000) >> 23) - 126;
43 /* Get the mantissa. */
47 SET_FLOAT_WORD (f
, wf
);
52 #ifdef _DOUBLE_IS_32BITS
54 double frexp (double x
, int *exp
)
56 return (double) frexpf ((float) x
, exp
);
59 #endif /* defined(_DOUBLE_IS_32BITS) */