Builtin Library
README.md
math.modf (procNode)
A value split into its whole part and the fraction left, element by element, both with the sign of the value: 3.25 is 3 and 0.25, and -3.25 is -3 and -0.25.
Built from the operations of proc.fieldc.operators that answer each output. Operands are numbers, vectors, Columns or Fields. When every operand is a plain number or vector the answer is the plain result, folded where the node cooks; otherwise the answer is a Field: a template over its operands that whatever reads it evaluates in one dispatch together with the chain around it. Nothing dispatches for this node alone. Over numbers and animated values the answer is an animated value: the operation at every time.
It calls the modf_integer and modf_fraction operations.
Inputs
a(Value, default 0). The value.
Outputs
integer. The whole part, cut toward zero.fraction. What is left: the value minus its whole part.
local whole, fraction = g.math.modf(-3.25) -- -3, -0.25