Created
January 23, 2018 16:34
-
-
Save gasolin/7e2b39c9e4bcd57c867cd5f871a92eb0 to your computer and use it in GitHub Desktop.
Revisions
-
gasolin created this gist
Jan 23, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ package main import ( "fmt" ) func Sqrt(x float64) float64 { z := float64(1) for i := 0; i < 100000; i++ { z = z - (z * z - x) / 2 * z } return z } func main() { fmt.Println(Sqrt(2)) }