← Docs
kotlin-stdlib / kotlin.math / hypot

hypot

Common
JVM
JS
Native
1.2
fun hypot ( x : Double , y : Double ) : Double
(Common source) (JVM source) (JS source) (Native source)
fun hypot ( x : Float , y : Float ) : Float
(Common source) (JVM source) (JS source) (Native 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
Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .