exp2()
Learn how to use the exp2() function to return the base-2 exponential value of x.
The base-2 exponential function of x, which is 2 raised to the power x: 2^x.
Syntax
exp2(x)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| x | real | ✔️ | The value of the exponent. |
Returns
Returns the exponential value of x.
Examples
The following example shows how to use the exp2() function to calculate the exponential value of 3.
print result = exp2(3)
Output:
result
8
Related content
- For natural (base-2) logarithms, see log2().
- For exponential functions of base-e and base-10 logarithms, see exp(), exp10().
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.