The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

frexp - extract mantissa and exponent from a double precision number

 SYNOPSIS



#include <math.h>

double frexp(double num, int *exp);

 DESCRIPTION

The frexp() function breaks a floating-point number into a normalised fraction and an integral power of 2. It stores the integer exponent in the int object pointed to by exp.

An application wishing to check for error situations should set errno to 0 before calling frexp(). If errno is non-zero on return, or the return value is NaN, an error has occurred.

 RETURN VALUE

The frexp() function returns the value x, such that x is a double with magnitude in the interval [½, 1) or 0, and num equals x times 2 raised to the power *exp.

If num is 0, both parts of the result are 0.

If num is NaN, NaN is returned, errno may be set to [EDOM] and the value of *exp is unspecified.

If num is ±Inf, num is returned, errno may be set to [EDOM] and the value of *exp is unspecified.

 ERRORS

The frexp() function may fail if:
[EDOM]
The value of num is NaN or ±Inf.

No other errors will occur.

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

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

DERIVATION

Derived from Issue 1 of the SVID.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]