Chapter Contents

Previous

Next
frexp

frexp



Floating-Point Conversion: Fraction-Exponent Split

Portability: ISO/ANSI C conforming, UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
USAGE NOTES
RELATED FUNCTIONS
SEE ALSO


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


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.