import ( "fmt" "math/big" ) func main() { a := big.NewInt(15) b := big.NewInt(10) res := a.Cmp(b) fmt.Println(res) // Output: 1 }
import ( "fmt" "math/big" ) func main() { a := new(big.Int) a.SetString("234567890123456789", 10) b := new(big.Int) b.SetString("123456789012345678", 10) res := a.Cmp(b) fmt.Println(res) // Output: 1 }In this example, two large `big.Int` values are defined using the `SetString` method and compared using the `Cmp` method. As `a` is greater than `b`, the result of the comparison is `1`. Package Library: The `math/big` package is part of the standard library in Go.