Standard library / math
math.Sqrt()
Nonnegative square root; negative finite input produces NaN. Expected stdout: '9\n'.
Formal Syntax & Structure
go syntaxgo
func Sqrt(x float64) float64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | float64 | First input operand (or sole input if unary). |
Return Value
float64
Nonnegative square root; negative finite input produces NaN.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { fmt.Println(math.Sqrt(81))}