math.modf() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.50 is the most recent stable version of Flux.

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(x: 3.14)

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

Parameters

x

The value used in the operation.

Data type: Float

Special cases

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