Commit 70f6133b authored by Andrew Gerrand's avatar Andrew Gerrand

doc: fix typo in Effective Go

Fixes #2120.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4810061
parent 9d7e3934
...@@ -2730,7 +2730,7 @@ suppresses the usual check for a <code>return</code> statement. ...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment