A Tour of Go
Exercise: Loops and Functions
https://tour.golang.org/flowcontrol/8
牛顿迭代法(简称“牛迭”)快速寻找平方根
上面的程序求 10, 20, 30 ... 100 的平方根,运行结果如下:
(括号里的数字是牛迭的循环次数,比如 5 表示循环了五次得出结果。)
参考:
https://nylira.com/a-tour-of-go-solutions/
https://gist.github.com/abesto/3476594
Exercise: Loops and Functions (牛顿迭代法快速寻找平方根)
原文:http://www.cnblogs.com/ahui2017/p/6358565.html