Math Functions
math.modf()
Split a real value into fractional and whole parts, both floats with the original sign.
Formal Syntax & Structure
python syntaxpython
math.modf(x, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | real number | Input real value. |
Return Value
tuple[float, float]
Pair (fractional part, whole part).
Working Example
Example Snippetpython
import mathprint(math.modf(-3.75))