floor

expect fun floor(x: Double): Double(source)

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

Since Kotlin

1.2

Return

the largest double value that is smaller than or equal to 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.


expect fun floor(x: Float): Float(source)

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

Since Kotlin

1.2

Return

the largest Float value that is smaller than or equal to 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.

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

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

Since Kotlin

1.2

Return

the largest double value that is smaller than or equal to 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.


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

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

Since Kotlin

1.2

Return

the largest Float value that is smaller than or equal to 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.

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

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

Since Kotlin

1.2

Return

the largest double value that is smaller than or equal to 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.


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

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

Since Kotlin

1.2

Return

the largest Float value that is smaller than or equal to 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.