floor

inline actual fun floor(x: Double): Double (source)

Platform and version requirements: Kotlin 1.2

Rounds the given value x to an integer towards negative infinity.

Return

the largest double value that is smaller than the given value x and is a mathematical integer.

Special cases:

  • floor(x) is x where x is NaN or +Inf or -Inf or already a mathematical integer.

inline actual fun floor(x: Float): Float (source)

Platform and version requirements: Kotlin 1.2

Rounds the given value x to an integer towards negative infinity.

Return

the largest Float value that is smaller than the given value x and is a mathematical integer.

Special cases:

  • floor(x) is x where x is NaN or +Inf or -Inf or already a mathematical integer.