Name
frexp, modf — decompose a floating-point value into mantissa/exponent or integer/fractional parts
Synopsis
frexp(
|
in x double precision); |
modf(
|
in x double precision); |
Description
These functions split an IEEE 754 double precision value into two component parts.
: frexp splits x into a normalized mantissa m (0.5 <= |m| < 1) and an integer exponent e such that x = m * 2^e.
: modf splits x into its integer and fractional parts, both having the same sign as x.
The component values are returned as a two-element vector. Use
aref to extract the
individual parts.
See also logb for
extracting just the exponent, and
ldexp for the
inverse of frexp.