HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)
l
ldexp(3M) ldexp(3M)
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 ∗ 2
exp
.
To use this function, make sure your program includes <
math.h>, and link in the math library by specify-
ing
-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.
SEE ALSO
frexp(3M), modf(3M), scalb(3M), scalbn(3M), math(5), values(5).
STANDARDS CONFORMANCE
ldexp(): SVID3, XPG4.2, ANSI C
HP-UX 11i Version 1: September 2005 − 1 − Hewlett-Packard Company Section 3−−519