Math Functions

math.exp2()

Raise two to a real exponent. Added in 3.11.

Formal Syntax & Structure

python syntaxpython
math.exp2(x, /)

Parameters & Attributes

NameTypeDescription
xreal numberInput real value.

Return Value

float

Floating-point result; finite precision and domain restrictions apply.

Working Example

Example Snippetpython
import mathprint(math.exp2(-3))
Python Reference