On this page
math.cbrt
Prev: math.atanh | Up: math | Next: math.ceil
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.cbrt
Tags: #public #python3 #stdlib #math
Import
import math
from math import cbrt
Signature & Overview
math.cbrt(x, /)
Return the cube root of x.
Usage
import math
assert math.isclose(math.cbrt(27.0), 3.0)
assert math.isclose(math.cbrt(-8.0), -2.0)
Gotchas
- Requires Python 3.11+: Handles negative numbers cleanly, unlike
(-8) ** (1/3)which produces acomplexnumber.
REPL Inspect
from math import cbrt
help(cbrt)
Linked from
Related notes
- tuts/python3/stdlib_module/math/atanh Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/ceil 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