Skip to content

Instantly share code, notes, and snippets.

View janlay's full-sized avatar

Janlay Wu janlay

View GitHub Profile
@janlay
janlay / sort.go
Created March 15, 2012 09:40
Tour of Go #43: implement the square root function using Newton's method.
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := 1.0
for i := 1; i <= 100; i++ {