frexp, modf, ldexp - traditional UNIX functions
double frexp(value, eptr)
double modf(value, iptr)
double value, *iptr;
These functions are provided for compatibility with other UNIX system
implementations. They are not used internally in libm or libc. Better
ways to accomplish similar ends may be found in ieee_functions(3M) and
ldexp(x,n) returns x * 2**n computed by exponent manipulation rather
than by actually performing an exponentiation or a multiplication.
Note: ldexp(x,n) differs from scalbn(x,n), defined in ieee_func-
tions(3M), only that in the event of IEEE overflow and underflow,
ldexp(x,n) sets errno to ERANGE.
Every non-zero number can be written uniquely as x * 2**n, where the
significant x is in the range 0.5 <= |x| < 1.0 and the exponent n is an
integer. The function frexp() returns the significant of a double
value as a double quantity, x, and stores the exponent n, indirectly
through eptr. If value == 0, both results returned by frexp() are 0.
modf() returns the fractional part of value and stores the integral
part indirectly through iptr. Thus the argument value and the returned
values modf() and *iptr satisfy
(*iptr + modf) == value
and both results have the same sign as value. The definition of modf()
varies among UNIX system implementations, so avoid modf() in portable
The results of frexp() and modf() are not defined when value is an IEEE
infinity or NaN.
21 January 1988 FREXP(3M)