Implementation status: to be implemented
double exp2(double x);
float exp2f(float x);
long double exp2l(long double x);
The functions compute the base-
2 exponential function of x, which is
e raised to the power x:
x - the value of which base-
2 exponential function is computed.
An application wishing to check for error situations sets
errno to zero and calls
feclearexcept(FE_ALL_EXCEPT) before calling these functions. On return, if
errno is non-zero or
fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
Upon successful completion, these functions return
If the correct value causes overflow, a range error occurs and
exp2l() return the value of the macro
If the correct value causes underflow, and is not representable, a range error occurs, and
If x is
NaN is returned.
If x is
1 is returned.
If x is -
+0 is returned.
If x is +
Inf, x is returned.
If the correct value causes underflow, and is representable, a range error occurs and the correct value is returned.
ERANGE] - the result overflows (overflow floating-point exception is raised) or
the result underflows (underflow floating-point exception is raised)
On error, the expressions (
math_errhandling & MATH_ERRNO) and (
math_errhandling & MATH_ERREXCEPT) are independent of each other, but at least one of them must be non-zero.