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.

Output data format: Record

import "math"

math.modf(f: 3.14)

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



The value used in the operation.

Special cases

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

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.