HP-UX Reference (11i v2 04/09) - 3 Library Functions A-M (vol 6)

f
frexp(3M) frexp(3M)
NAME
frexp( ), frexpf( ), frexpl( ), frexpw( ), frexpq( ) - extract mantissa and exponent from floating-point number
SYNOPSIS
#include <math.h>
double frexp(double value, int *exp);
Itanium(R)-based System Only
float frexpf(float value, int *exp);
long double frexpl(long double value, int *exp);
extended frexpw(extended value, int *exp);
quad frexpq(quad value, 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.
Itanium-based System Only
frexpf() is a float version of frexp(); it takes a float first argument and returns a
float
result.
frexpl() is a long double version of frexp(); it takes a long double first argument and
returns a long double result.
frexpw() is an extended version of frexp(); it takes an extended first argument and returns an
extended result. frexpq() is equivalent to frexpl() on HP-UX systems.
USAGE
To use (for Itanium-based systems)
frexpf(), compile either with the default -Ae option or with the
-Aa option.
To use (for Itanium-based systems)
frexpl(), frexpw(),orfrexpq(), compile either with the
default
-Ae option or with the -Aa and -D_HPUX_SOURCE
options.
To use (for Itanium-based systems)
frexpw() or frexpq(), compile also with the -fpwidetypes
option.
To use any of these functions, make sure your program includes
<math.h>, and link in the math library
by specifying -lm on the compiler or linker command line. For more information, see the HP-UX
Floating-Point Guide.
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 value equals x times 2 raised to the power *exp.
If value is zero, returns value and stores zero in the object pointed to by exp.
If value is NaN,
frexp() returns NaN, and the value of *exp is unspecified.
If value is ±INFINITY,
frexp() returns value, and the value of *exp is unspecified.
These functions raise no exceptions.
ERRORS
No errors are defined.
SEE ALSO
ilogb(3M), ldexp(3M), logb(3M), modf(3M), scalb(3M), scalbln(3M), scalbn(3M), math(5).
STANDARDS CONFORMANCE
frexp() : SVID3, XPG4.2, ANSI C, ISO/IEC C99 (including Annex F, ‘‘IEC 60559 floating-point arith-
metic’’)
frexpf(), frexpl() : ISO/IEC C99 (including Annex F, ‘‘IEC 60559 floating-point arithmetic’’)
Section 3338 Hewlett-Packard Company 1 HP-UX 11i Version 2: September 2004