1
0
mirror of https://github.com/golang/go synced 2024-11-21 14:24:44 -07:00

doc: fix typo in Effective Go

Fixes #2120.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4810061
This commit is contained in:
Andrew Gerrand 2011-07-31 15:25:26 -07:00
parent 9d7e39340d
commit 70f6133b84

View File

@ -2730,7 +2730,7 @@ suppresses the usual check for a <code>return</code> statement.
<pre> <pre>
// A toy implementation of cube root using Newton's method. // A toy implementation of cube root using Newton's method.
func CubeRoot(x float64) float64 { func CubeRoot(x float64) float64 {
z := x/3 // Arbitrary intitial value z := x/3 // Arbitrary initial value
for i := 0; i &lt; 1e6; i++ { for i := 0; i &lt; 1e6; i++ {
prevz := z prevz := z
z -= (z*z*z-x) / (3*z*z) z -= (z*z*z-x) / (3*z*z)