Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Newton's method, solving
package main
import (
func Sqrt(x float64) float64 {
z := 1.0
l := 0.0
for math.Abs(z-l)>9e-15 {
l = z
z = z - (z*z - x)/(2*z)
return z
func main() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.