abs

Common
fun abs(x: Double): Double

Returns the absolute value of the given value x.

Special cases:

  • abs(NaN) is NaN

Since Kotlin

1.2

See also

absoluteValue

extension property for Double

inline fun abs(x: Double): Double

Returns the absolute value of the given value x.

Special cases:

  • abs(NaN) is NaN

Since Kotlin

1.2

See also

absoluteValue

extension property for Double

JS
inline fun abs(x: Double): Double

Returns the absolute value of the given value x.

Special cases:

  • abs(NaN) is NaN

Since Kotlin

1.2

See also

absoluteValue

extension property for Double

Native
external fun abs(x: Double): Double

Returns the absolute value of the given value x.

Special cases:

  • abs(NaN) is NaN

Since Kotlin

1.2

See also

absoluteValue

extension property for Double

Common
fun abs(x: Float): Float

Returns the absolute value of the given value x.

Special cases:

  • abs(NaN) is NaN

Since Kotlin

1.2

See also

absoluteValue

extension property for Float

inline fun abs(x: Float): Float

Returns the absolute value of the given value x.

Special cases:

  • abs(NaN) is NaN

Since Kotlin

1.2

See also

absoluteValue

extension property for Float

JS
inline fun abs(x: Float): Float

Returns the absolute value of the given value x.

Special cases:

  • abs(NaN) is NaN

Since Kotlin

1.2

See also

absoluteValue

extension property for Float

Native
external fun abs(x: Float): Float

Returns the absolute value of the given value x.

Special cases:

  • abs(NaN) is NaN

Since Kotlin

1.2

See also

absoluteValue

extension property for Float

Common
fun abs(n: Int): Int

Returns the absolute value of the given value n.

Special cases:

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

Since Kotlin

1.2

See also

absoluteValue

extension property for Int

inline fun abs(n: Int): Int

Returns the absolute value of the given value n.

Special cases:

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

Since Kotlin

1.2

See also

absoluteValue

extension property for Int

JS
fun abs(n: Int): Int

Returns the absolute value of the given value n.

Special cases:

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

Since Kotlin

1.2

See also

absoluteValue

extension property for Int

Native
external fun abs(n: Int): Int

Returns the absolute value of the given value n.

Special cases:

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

Since Kotlin

1.2

See also

absoluteValue

extension property for Int

Common
fun abs(n: Long): Long

Returns the absolute value of the given value n.

Special cases:

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

Since Kotlin

1.2

See also

absoluteValue

extension property for Long

inline fun abs(n: Long): Long

Returns the absolute value of the given value n.

Special cases:

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

Since Kotlin

1.2

See also

absoluteValue

extension property for Long

JS
fun abs(n: Long): Long

Returns the absolute value of the given value n.

Special cases:

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

Since Kotlin

1.2

See also

absoluteValue

extension property for Long

Native
external fun abs(n: Long): Long

Returns the absolute value of the given value n.

Special cases:

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

Since Kotlin

1.2

See also

absoluteValue

extension property for Long