ceil

Common
JVM
JS
Native
1.2
fun ceil(x: Double): Double

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

Return

the smallest double value that is greater than or equal to the given value x and is a mathematical integer.

Special cases:

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

Common
JVM
JS
Native
1.2
fun ceil(x: Float): Float

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

Return

the smallest Float value that is greater than or equal to the given value x and is a mathematical integer.

Special cases:

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