A Tour of Go Exercise Solutions

As I am going through the Tour of Go I found there are some exercise that require some problem solving. I’d like to share my solutions that I’ve come up with for these. I’ll be updating these as I complete the tour of go! Exercise: Loops and Functions package main import ( "fmt" "math" ) func Sqrt(x float64) float64 { z := 1.0 prevZ := z diff := 0.00000001 for { z -= (z*z - x) / (2*z) if diff > math....

April 25, 2021 · 2 min · Alex