package main
import (
"fmt"
"math/big"
)
func main() {
fmt.Println(new(big.Int).AndNot(big.NewInt(0xff), big.NewInt(-1)))
}
This should print 0. It does print 2.
The bug is in math/big/int.go:893, it should use sub, not add, as the comment in the previous line specifies.