function
<cmath> <ctgmath>
exp2double exp2 (double x); float exp2f (float x);long double exp2l (long double x);
double exp2 (double x); float exp2 (float x);long double exp2 (long double x); double exp2 (T x); // additional overloads for integral types
Compute binary exponential function
Returns the base-2 exponential function of x, which is2
raised to the power x: 2x
.
Header
<tgmath.h>provides a type-generic macro version of this function.
are provided in this header (
<cmath>
) for the
integral types: These overloads effectively cast
xto a
double
before calculations (defined for
Tbeing any
integral type).
2
raised to the power of x.
If an overflow range error occurs:
1
2
3
4
5
6
7
8
9
10
11
12
/* exp2 example */
#include <stdio.h> /* printf */
#include <math.h> /* exp2 */
int main ()
{
double param, result;
param = 8.0;
result = exp2 (param);
printf ("2 ^ %f = %f.\n", param, result );
return 0;
}
2 ^ 8.000000 is 256.000000.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4