Go to the first, previous, next, last section, table of contents.
#include <math.h> double ldexp(double val, int exp);
This function computes val*2^exp.
val*2^exp. ldexp(0., exp)
returns 0 for all
values of exp
, without setting errno
. For non-zero values
of val, errno
is set to ERANGE
if the result cannot
be accurately represented by a double
, and the return value is
then the nearest representable double
(possibly, an Inf
).
If val is a NaN
or Inf
, the return value is
NaN
and errno
is set to EDOM
.
ANSI, POSIX
ldexp(3.5,4) == 3.5 * (2^4) == 56.0
Go to the first, previous, next, last section, table of contents.