Go Cookbook
上QQ阅读APP看书,第一时间看更新

Working with numeric data types using math and math/big

The math and math/big packages focus on exposing more complex mathematical operations to the Go language, such as Pow, Sqrt, and Cos. The math package itself operates predominately on float64 unless a function says otherwise. The math/big package is for numbers that are too large to represent in a 64-bit value. This recipe will show some basic usage of the math package and demonstrate math/big for fibonacci.