C Programming/math.h/frexp

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

frexp()[edit | edit source]

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.

Format[edit | edit source]

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

Return value[edit | edit source]

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

References[edit | edit source]