exp2 - C math.h

C examples for math.h:exp2

Type

function

From

<cmath>
<ctgmath>
<math.h>

Description

Returns the base-2 exponential function of x, which is 2 raised to the power x: 2^x.

Prototype

long double exp2l (long double x);
long double exp2 (long double x);
     double exp2  (double x);
      float exp2f (float x);
      float exp2 (float x);
     double exp2 (T x);           

Parameters

Parameter Description
x Value of the exponent.

Return Value

2 raised to the power of x.

Example

Demo Code

#include <stdio.h>
#include <math.h> /* exp2 */

int main ()//  w w w.  j  a  v a2 s .c om
{
  double param = 8.0;
  double result = exp2 (param);
  printf ("2 ^ %f = %f.\n", param, result );
  return 0;
}

Related Tutorials