C Programming/math.h/frexp

From Wikibooks, open books for an open world
Jump to: navigation, search


We used frexp() in mathematical purpose.The frexp() is function which break the floating point value into two part. First in mantissa and second in exponent.We can express x as floating point value, m as mantissa and n as exponent. In frexp(), the range of mantissa is always between 0.5 to 1.


double frexp(double x, int *exppr);
float frexpf(float x, int *exppr);
long double frexpl(long double x, int *exppr);

Return value[edit]

The frexp() function return mantissa.The exppr pointed to the location where exponent is stored. x=mantissa*2exponent