hypot

expect fun hypot(x: Double, y: Double): Double(source)
expect fun hypot(x: Float, y: Float): Float(source)

Computes sqrt(x^2 + y^2) without intermediate overflow or underflow.

Special cases:

  • returns +Inf if any of arguments is infinite

  • returns NaN if any of arguments is NaN and the other is not infinite

Since Kotlin

1.2
actual inline fun hypot(x: Double, y: Double): Double(source)
actual inline fun hypot(x: Float, y: Float): Float(source)

Computes sqrt(x^2 + y^2) without intermediate overflow or underflow.

Special cases:

  • returns +Inf if any of arguments is infinite

  • returns NaN if any of arguments is NaN and the other is not infinite

Since Kotlin

1.2
actual inline fun hypot(x: Double, y: Double): Double(source)
actual inline fun hypot(x: Float, y: Float): Float(source)

Computes sqrt(x^2 + y^2) without intermediate overflow or underflow.

Special cases:

  • returns +Inf if any of arguments is infinite

  • returns NaN if any of arguments is NaN and the other is not infinite

Since Kotlin

1.2
actual external fun hypot(x: Double, y: Double): Double(source)
actual external fun hypot(x: Float, y: Float): Float(source)

Computes sqrt(x^2 + y^2) without intermediate overflow or underflow.

Special cases:

  • returns +Inf if any of arguments is infinite

  • returns NaN if any of arguments is NaN and the other is not infinite

Since Kotlin

1.3
actual fun hypot(x: Double, y: Double): Double(source)
actual fun hypot(x: Float, y: Float): Float(source)

Computes sqrt(x^2 + y^2) without intermediate overflow or underflow.

Special cases:

  • returns +Inf if any of arguments is infinite

  • returns NaN if any of arguments is NaN and the other is not infinite

Since Kotlin

1.8
actual fun hypot(x: Double, y: Double): Double(source)
actual fun hypot(x: Float, y: Float): Float(source)

Computes sqrt(x^2 + y^2) without intermediate overflow or underflow.

Special cases:

  • returns +Inf if any of arguments is infinite

  • returns NaN if any of arguments is NaN and the other is not infinite

Since Kotlin

1.8