docs-v2/content/v2.0/reference/flux/functions/math/modf.md

736 B

title description menu weight
math.modf() function The math.modf() function returns integer and fractional floating-point numbers that sum to `f`. Both values have the same sign as `f`.
v2_0_ref
name parent
math.modf Math
301

The math.modf() function returns integer and fractional floating-point numbers that sum to f. Both values have the same sign as f.

Output data format: Object

import "math"

math.modf(f: 3.14)

// Returns {int: 3, frac: 0.14000000000000012}

Parameters

f

The value used in the operation.

Data type: Float

Special cases

math.modf(f: ±Inf) // Returns {int: ±Inf, frac: NaN}
math.modf(f: NaN)  // Returns {int: NaN, frac: NaN}