To find the square root of a specified number in Go, use the Sqrt()
function from the math
package.
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(math.Sqrt(2))
}
Output:
1.4142135623730951
Please consider supporting us by disabling your ad blocker
To find the square root of a specified number in Go, use the Sqrt()
function from the math
package.
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(math.Sqrt(2))
}
Output:
1.4142135623730951