max

Platform and version requirements: JVM (1.2), JS (1.2), Native (1.2)
fun max(a: Double, b: Double): Double
fun max(a: Float, b: Float): Float

Returns the greater of two values.

If either value is NaN, then the result is NaN.

Platform and version requirements: JVM (1.2), JS (1.2), Native (1.2)
fun max(a: Int, b: Int): Int
fun max(a: Long, b: Long): Long

Returns the greater of two values.

Platform and version requirements: JVM (1.5), JS (1.5), Native (1.5)
fun max(a: UInt, b: UInt): UInt
fun max(a: ULong, b: ULong): ULong

Returns the greater of two values.

© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.math/max.html