LDEXP(3) Library Functions Manual LDEXP(3)

ldexpmultiply by integer power of 2

#include <math.h>

double
ldexp(double x, int n);

long double
ldexpl(long double x, int n);

float
ldexpf(float x, int n);

The () functions multiply x by 2 to the power n.

ldexp(±0, n) returns ±0.

(x, 0) returns x.

(±infinity, n) returns ±infinity.

math(3), scalbn(3)

The ldexp() functions conform to ISO/IEC 9899:2011.

December 11, 2006 Mac OS X 12