HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)
f
frexp(3M) frexp(3M)
NAME
frexp( ) - extract mantissa and exponent from double-precision number
SYNOPSIS
#include <math.h>
double frexp(double num, int *exp);
DESCRIPTION
The frexp() function breaks a floating-point number into a normalized fraction and an integral power of
2. It stores the integer exponent in the
int object pointed to by exp.
To use this function, make sure your program includes <
math.h>, and link in the math library by specify-
ing
-lm on the compiler or linker command line.
RETURN VALUE
The frexp() function returns the value x, such that x is a
double with magnitude in the interval [0.5,
1] or zero, and num equals x times 2 raised to the power *exp.
If num is zero, both parts of the result are zero.
If num is NaN,
frexp() returns NaN, and the value of *exp is unspecified.
If num is ±INFINITY, frexp() returns num, and the value of *exp is unspecified.
ERRORS
No errors are defined.
SEE ALSO
ldexp(3M), modf(3M), scalb(3M), scalbn(3M), math(5).
STANDARDS CONFORMANCE
frexp(): SVID3, XPG4.2, ANSI C
Section 3−−280 Hewlett-Packard Company − 1 − HP-UX 11i Version 1: September 2005