OAR

RTEMS GNU Tools On-Line Library


frexp

PREV UP NEXT Bookshelf

1.16: frexp, frexpf---split floating-point number

Synopsis

#include <math.h>
double frexp(double val, int *exp);
float frexpf(float val, int *exp);

Description
All non zero, normal numbers can be described as m * 2**p. frexp represents the double val as a mantissa m and a power of two p. The resulting mantissa will always be greater than or equal to 0.5, and less than 1.0 (as long as val is nonzero). The power of two will be stored in *exp.

m and p are calculated so that val is m times 2 to the power p.

frexpf is identical, other than taking and returning floats rather than doubles.


Returns
frexp returns the mantissa m. If val is 0, infinity, or Nan, frexp will set *exp to 0 and return val.


Portability
frexp is ANSI. frexpf is an extension.



PREV UP NEXT Bookshelf

Packaging copyright © 1988-2000 OAR Corporation
Context copyright by each document's author. See Free Software Foundation for information.