Javatpoint Logo
Javatpoint Logo

C++ Math exp2()

The function computes the base - 2 exponential function of a given number.

Suppose a number is 'x':

Syntax

Parameter

x: It is the value of the exponent.

Return value

It returns, 2 raised to the power x.

Example 1

Let's see a simple example when the value of x is positive

Output:

Value of x is : 4
exp2(x) = 16

Example 2

Let's see a simple example when the value of x is negative.

Output:

Value of x is : -2
exp2(x) = 0.25

Next TopicC++ Math Functions





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA