From: Katrina Owen Date: Wed, 29 May 2013 03:49:51 +0000 (+1000) Subject: doc: Fix typo in approximation of square root X-Git-Tag: go1.2rc2~1389 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=605da0e2a23fbaadca9bd056a3cf04ecac507add;p=gostls13.git 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 f64dd6a2ad..2bf50601e4 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 }