package main import ( "fmt" "math/big" ) func main() { // Create two big integers x := big.NewInt(123) y := big.NewInt(45) // Subtract y from x result := big.NewInt(0) result.Sub(x, y) fmt.Println(result) // Output: 78 }
package main import ( "fmt" "math/big" ) func main() { // Create two big integers x := big.NewInt(456) y := big.NewInt(789) // Subtract y from x result := new(big.Int).Sub(x, y) fmt.Println(result) // Output: -333 }In this example, we create two big integers `x` and `y`, and use the `Sub` method to subtract `y` from `x` directly in the `fmt.Println` statement. The result is stored in the `result` variable and printed to the console. So the package library used in these examples is `math/big`.