← Docs
kotlin-stdlib / kotlin.math / sqrt

sqrt

Common
JVM
JS
Native
1.2
fun sqrt ( x : Double ) : Double
(Common source) (JVM source) (JS source) (Native source)
fun sqrt ( x : Float ) : Float
(Common source) (JVM source) (JS source) (Native source)

Computes the positive square root of the value x .

Special cases:

  • sqrt(x) is NaN when x < 0 or x is NaN
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 .