HP-UX Reference (11i v2 07/12) - 3 Library Functions A-M (vol 6)

e
exp2(3M) exp2(3M)
NAME
exp2(), exp2f(), exp2l(), exp2w(), exp2q() - base-2 exponential functions
SYNOPSIS
#include <math.h>
double exp2(double x);
Itanium(R)-based System Only
float exp2f(float x);
long double exp2l(long double x);
extended exp2w(extended x);
quad exp2q(quad x);
DESCRIPTION
exp2() returns 2
x
.
Itanium-based Sysstem Only
exp2f() is a float version of exp2(); it takes a float argument and returns a float
result.
exp2l() is a long double version of exp2(); it takes a long double argument and returns a
long double result.
exp2w() is an extended version of exp2(); it takes an extended argument and returns an
extended result.
exp2q() is equivalent to exp2l() on HP-UX systems.
USAGE
To use these functions, compile either with the default -Ae option or with the -Aa
and
-D_HPUX_SOURCE options.
To use (for Itanium-based systems)
exp2w() or exp2q(), compile also with the -fpwidetypes
option.
To use these functions, make sure your program includes
<math.h>, and link in the math library by
specifying -lm on the compiler or linker command line.
For more information, see the HP-UX Floating-Point Guide.
RETURN VALUE
exp2(±0) returns 1.
If x is +INFINITY, exp2() returns +INFINITY.
If x is INFINITY,
exp2() returns zero.
If x is NaN, exp2() returns NaN.
exp2() returns infinity (equal to HUGE_VAL) in lieu of a value whose magnitude is too large, and raises
the overflow and inexact exceptions.
exp2() raises the underflow and inexact exceptions whenever a result is tiny (essentially denormal or
zero) and thereby suffers loss of accuracy, and may raise those exceptions if the result is merely tiny.
exp2() raises the inexact exception whenever a rounded result does not equal the mathematical result.
ERRORS
Itanium-based System Only
If the correct value would overflow, exp2() sets errno to [ERANGE].
HP-UX libm functions on Itanium-based systems do not set errno by default. For errno setting, com-
pile with the
+Olibmerrno option.
SEE ALSO
cbrt(3M), exp(3M), exp10(3M), expm1(3M), log2(3M), pow(3M), sqrt(3M), math(5).
384 Hewlett-Packard Company 1 HP-UX 11i Version 2: December 2007 Update