round

expect fun round(x: Double): Double(source)
expect fun round(x: Float): Float(source)

Rounds the given value x towards the closest integer with ties rounded towards even integer.

Special cases:

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

Since Kotlin

1.2
actual fun round(x: Double): Double(source)
actual inline fun round(x: Float): Float(source)

Rounds the given value x towards the closest integer with ties rounded towards even integer.

Special cases:

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

Since Kotlin

1.2
actual inline fun round(x: Double): Double(source)
actual inline fun round(x: Float): Float(source)

Rounds the given value x towards the closest integer with ties rounded towards even integer.

Special cases:

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

Since Kotlin

1.2
actual external fun round(x: Double): Double(source)
actual external fun round(x: Float): Float(source)

Rounds the given value x towards the closest integer with ties rounded towards even integer.

Special cases:

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

Since Kotlin

1.3