package main import ( "fmt" "math/big" ) func main() { var n big.Int n.SetInt64(123456789) fmt.Println(n.String()) // Output: 123456789 }
package main import ( "fmt" "math/big" ) func main() { var a, b, c big.Int a.SetInt64(100) b.SetInt64(200) c.Add(&a, &b) fmt.Println(c.String()) // Output: 300 }In this example, we create three `big.Int` variables `a`, `b`, and `c`. We set the values of `a` and `b` to `100` and `200` using `SetInt64`, respectively. We then add `a` and `b` together using the `Add` method, and store the result in `c`. We print out the value of `c` using the `String` method. The package library for `math/big` is the standard library for arbitrary-precision arithmetic in Go.