round

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

Platform and version requirements: Kotlin 1.2

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

Platform and version requirements: Kotlin 1.2

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.