HPlogo HP-UX Reference Volume 4 of 5 > f

frexp(3M)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

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 specifying -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.

STANDARDS CONFORMANCE

frexp(): SVID3, XPG4.2, ANSI C

© Hewlett-Packard Development Company, L.P.