Math Functions
math.exp2()
Raise two to a real exponent. Added in 3.11.
Formal Syntax & Structure
python syntaxpython
math.exp2(x, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | real number | Input real value. |
Return Value
float
Floating-point result; finite precision and domain restrictions apply.
Working Example
Example Snippetpython
import mathprint(math.exp2(-3))