frexp(), frexpf()

break floating point number into fraction and power of 2 

Function


SYNOPSIS

#include <math.h>

double frexp(double value, int *eptr); float frexpf(float value, int *eptr);


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

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

The frexpf() function is a single-precision version of frexp().


PARAMETERS

value 

Is the number whose exponent to be computed.

eptr 

Is the returned exponent.


RETURN VALUES

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

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

For both functions, if value is 0, both parts of the result are 0. For both functions, if value is NaN, NaN is returned, errno is set to EDOM and the value of *exp is unspecified.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
fabs(), floor(), fmod(), modf()


PTC MKS Toolkit 10.5 Documentation Build 40.