On this page
math.frexp
Prev: math.fmod | Up: math | Next: math.fsum
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.frexp
Tags: #public #python3 #stdlib #math
Import
import math
from math import frexp
Signature & Overview
math.frexp(x, /)
Return the mantissa and exponent of x, as pair (m, e).
Usage
import math
m, e = math.frexp(12.0)
assert m == 0.75 and e == 4 and m * (2 ** e) == 12.0
Gotchas
- Inverse of
math.ldexp(m, e): Splits a float into mantissamin[0.5, 1.0)(or0.0) and integer exponente.
REPL Inspect
from math import frexp
help(frexp)
Linked from
Related notes
- tuts/python3/stdlib_module/math/fmod Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/fsum 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