frexp -- Floating-Point Conversion: Fraction-Exponent Split

SYNOPSIS

 #include <math.h>

 double frexp(double y, int *j);
 

DESCRIPTION

frexp separates a floating-point argument y into a fraction and an integer exponent of 2.

RETURN VALUE

frexp returns a real number that is equal to or greater than .5 and less than 1.0. The exponent of 2 is stored in the location addressed by j.

USAGE NOTES

frexp is useful in situations that require repeated multiplication by 2. If the next multiplication causes an overflow or underflow, you can use frexp to separate the mantissa from the exponent. This gives you complete control over the exponent and mantissa so you can operate on them separately without any loss of precision.

RELATED FUNCTIONS

ldexp

SEE ALSO

Mathematical Functions

Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.