math.floor() function

The math.floor() function returns the greatest integer value less than or equal to x.

*Output data type: Float*

  1. import "math"
  2. math.floor(x: 1.22)
  3. // Returns 1.0

Parameters

x

The value used in the operation.

*Data type: Float*

Special cases

  1. math.floor0) // Returns ±0
  2. math.floorInf) // Returns ±Inf
  3. math.floor(NaN) // Returns NaN