.\" Modified 2002-07-27 by Walter Harms
.\" (walter.harms@informatik.uni-oldenburg.de)
.\"
-.TH FREXP 3 2016-03-15 "" "Linux Programmer's Manual"
+.TH FREXP 3 2017-09-15 "" "Linux Programmer's Manual"
.SH NAME
frexp, frexpf, frexpl \- convert floating-point number to fractional
and integral components
.B #include <math.h>
.PP
.BI "double frexp(double " x ", int *" exp );
-.br
.BI "float frexpf(float " x ", int *" exp );
-.br
.BI "long double frexpl(long double " x ", int *" exp );
.fi
.PP
times a power of two,
and its absolute value is always in the range 1/2 (inclusive) to
1 (exclusive), that is, [0.5,1).
-
+.PP
If
.I x
is zero, then the normalized fraction is
zero and zero is stored in
.IR exp .
-
+.PP
If
.I x
is a NaN,
a NaN is returned, and the value of
.I *exp
is unspecified.
-
+.PP
If
.I x
is positive infinity (negative infinity),
.TE
.SH CONFORMING TO
C99, POSIX.1-2001, POSIX.1-2008.
-
+.PP
The variant returning
.I double
also conforms to
SVr4, 4.3BSD, C89.
.SH EXAMPLE
The program below produces results such as the following:
-.sp
-.nf
+.PP
.in +4n
+.EX
.RB "$" " ./a.out 2560"
frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560
.RB "$" " ./a.out \-4"
frexp(\-4, &e) = \-0.5: \-0.5 * 2^3 = \-4
+.EE
.in
-.fi
.SS Program source
\&
-.nf
+.EX
#include <math.h>
#include <float.h>
#include <stdio.h>
x, r, r, FLT_RADIX, exp, x);
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR ldexp (3),
.BR modf (3)