W3cubDocs

/Kotlin

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.3), JS (1.3), Native (1.3)
@ExperimentalUnsignedTypes fun max(a: UInt, b: UInt): UInt
@ExperimentalUnsignedTypes fun max(a: ULong, b: ULong): ULong

Returns the greater of two values.

© 2010–2020 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