math.remainder() function

The math.remainder() function returns the IEEE 754 floating-point remainder of x / y.

*Output data type: Float*

  1. import "math"
  2. math.remainder(x: 21.0, y: 4.0)
  3. // Returns 1.0

Parameters

x

The numerator used in the operation.

*Data type: Float*

y

The denominator used in the operation.

*Data type: Float*

Special cases

  1. math.remainder(x: ±Inf, y:y) // Returns NaN
  2. math.remainder(x: NaN, y:y) // Returns NaN
  3. math.remainder(x:x, y: 0) // Returns NaN
  4. math.remainder(x:x, y: ±Inf) // Returns x
  5. math.remainder(x:x, y: NaN) // Returns NaN