abs

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

Platform and version requirements: Kotlin 1.2

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

Platform and version requirements: Kotlin 1.2

Returns the absolute value of the given value x.

Special cases:

  • abs(NaN) is NaN

See Also

absoluteValue

inline actual fun abs(n: Int): Int (source)

Platform and version requirements: Kotlin 1.2

Returns the absolute value of the given value n.

Special cases:

  • abs(Int.MIN_VALUE) is Int.MIN_VALUE due to an overflow

See Also

absoluteValue

inline actual fun abs(n: Long): Long (source)

Platform and version requirements: Kotlin 1.2

Returns the absolute value of the given value n.

Special cases:

  • abs(Long.MIN_VALUE) is Long.MIN_VALUE due to an overflow

See Also

absoluteValue