diff --git a/doc/code.html b/doc/code.html index f64dd6a2ad1..2bf50601e45 100644 --- a/doc/code.html +++ b/doc/code.html @@ -295,9 +295,9 @@ package newmath // Sqrt returns an approximation to the square root of x. func Sqrt(x float64) float64 { - z := 0.0 + z := 1.0 for i := 0; i < 1000; i++ { - z -= (z*z - x) / (2 * x) + z -= (z*z - x) / (2 * z) } return z }