commit | 605da0e2a23fbaadca9bd056a3cf04ecac507add | [log] [tgz] |
---|---|---|
author | Katrina Owen <katrina.owen@gmail.com> | Wed May 29 13:49:51 2013 +1000 |
committer | Andrew Gerrand <adg@golang.org> | Wed May 29 13:49:51 2013 +1000 |
tree | 9ecbee7be7b133c55373ca71945d99ce21993f71 | |
parent | 28c64e300663a34067d09f2e6536cd72e6e0bf01 [diff] |
doc: Fix typo in approximation of square root See https://en.wikipedia.org/wiki/Newton%27s_method#Square_root_of_a_number R=golang-dev, minux.ma, adg CC=golang-dev https://golang.org/cl/9145044
diff --git a/doc/code.html b/doc/code.html index f64dd6a..2bf5060 100644 --- a/doc/code.html +++ b/doc/code.html
@@ -295,9 +295,9 @@ // 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 }