absoluteValue
Platform and version requirements: Native (1.2)
val Double.absoluteValue: Double
Platform and version requirements: JVM (1.2), JS (1.2)
inline val Double.absoluteValue: Double
Platform and version requirements: Native (1.2)
val Float.absoluteValue: Float
Platform and version requirements: JVM (1.2), JS (1.2)
inline val Float.absoluteValue: Float
Platform and version requirements: Native (1.2)
val Int.absoluteValue: Int
Platform and version requirements: JVM (1.2), JS (1.2)
inline val Int.absoluteValue: Int
Returns the absolute value of this value.
Special cases:
-
Int.MIN_VALUE.absoluteValue
isInt.MIN_VALUE
due to an overflow
See Also
Platform and version requirements: Native (1.2)
val Long.absoluteValue: Long
Platform and version requirements: JVM (1.2), JS (1.2)
inline val Long.absoluteValue: Long
Returns the absolute value of this value.
Special cases:
-
Long.MIN_VALUE.absoluteValue
isLong.MIN_VALUE
due to an overflow
See Also
© 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/absolute-value.html