NAME
ldexp() — load exponent of a floating-point number
SYNOPSIS
#include <math.h>
double ldexp(double x, int exp);
DESCRIPTION
The
ldexp()
function computes the quantity
x* 2exp.
To use this function, make sure your program includes
<math.h>,
and link in the math library by specifying
-lm
on the compiler or linker command line.
RETURN VALUE
Upon successful completion, the
ldexp()
function returns a
double
representing the value
x
multiplied by 2 raised to the power
exp.
If
x
is NaN,
ldexp()
returns NaN.
If the correct value after rounding would be smaller in magnitude than
MINDOUBLE,
ldexp()
returns zero.
If the correct value would overflow,
ldexp()
returns
±HUGE_VAL
(according to the sign of
x)
and sets
errno
to [ERANGE].
ERRORS
If
ldexp()
fails,
errno
is set to one of the following values.
- [ERANGE]
The correct value would overflow.
STANDARDS CONFORMANCE
ldexp(): SVID3, XPG4.2, ANSI C