On this page
math.exp2
Prev: math.exp | Up: math | Next: math.expm1
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.exp2
Tags: #public #python3 #stdlib #math
Import
import math
from math import exp2
Signature & Overview
math.exp2(x, /)
Return 2 raised to the power of x.
Usage
import math
assert math.exp2(10) == 1024.0
assert math.isclose(math.exp2(-2), 0.25)
Gotchas
- Requires Python 3.11+: More accurate than
2.0 ** xfor fractional powers of 2.
REPL Inspect
from math import exp2
help(exp2)
Linked from
Related notes
- tuts/python3/stdlib_module/math/exp Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/expm1 Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/math/acos Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/acosh Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asin Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asinh Linked here; shared tags: #math, #stdlib
- tuts/c/stdlib/math shared tags: #math, #stdlib
- tuts/c/stdlib/math/fabs shared tags: #math, #stdlib
- tuts/c/stdlib/math/floor shared tags: #math, #stdlib