Copyright © 1997 The Open Group

frexp - extract mantissa and exponent from a double precision number

`#include <math.h> double frexp(double`

num, int *exp);

Thefrexp()function breaks a floating-point number into a normalised fraction and an integral power of 2. It stores the integer exponent in theintobject pointed to byexp.An application wishing to check for error situations should set

errnoto 0 before callingfrexp(). Iferrnois non-zero on return, or the return value is NaN, an error has occurred.

Thefrexp()function returns the valuex, such thatxis adoublewith magnitude in the interval [½, 1) or 0, andnumequalsxtimes 2 raised to the power*exp.If

numis 0, both parts of the result are 0.If

numis NaN, NaN is returned,errnomay be set to [EDOM] and the value of*expis unspecified.If

numis ±Inf,numis returned,errnomay be set to [EDOM] and the value of*expis unspecified.

Thefrexp()function may fail if:

- [EDOM]
- The value of
numis NaN or ±Inf.No other errors will occur.

None.

None.

None.

isnan(),ldexp(),modf(),<math.h>.

Derived from Issue 1 of the SVID.

Copyright © 1997 The Open Group

[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]