aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/math
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-03-06 16:19:05 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-03-06 16:19:05 +0000
commitc271e224c2e6bcda1068754def0b0cfd6a2b2958 (patch)
tree122e64d46042099f2d5b39e31532f3d0358b5ad3 /libgo/go/math
parent81b0d9065c3c832af6621e79e9d9b3c2bc684122 (diff)
downloadgcc-c271e224c2e6bcda1068754def0b0cfd6a2b2958.zip
gcc-c271e224c2e6bcda1068754def0b0cfd6a2b2958.tar.gz
gcc-c271e224c2e6bcda1068754def0b0cfd6a2b2958.tar.bz2
libgo: Upgrade to Go 1.4.2 release.
From-SVN: r221245
Diffstat (limited to 'libgo/go/math')
-rw-r--r--libgo/go/math/big/int.go2
-rw-r--r--libgo/go/math/big/int_test.go1
2 files changed, 2 insertions, 1 deletions
diff --git a/libgo/go/math/big/int.go b/libgo/go/math/big/int.go
index d22e39e..ade5c2f 100644
--- a/libgo/go/math/big/int.go
+++ b/libgo/go/math/big/int.go
@@ -887,7 +887,7 @@ func (z *Int) AndNot(x, y *Int) *Int {
}
// x &^ (-y) == x &^ ^(y-1) == x & (y-1)
- y1 := nat(nil).add(y.abs, natOne)
+ y1 := nat(nil).sub(y.abs, natOne)
z.abs = z.abs.and(x.abs, y1)
z.neg = false
return z
diff --git a/libgo/go/math/big/int_test.go b/libgo/go/math/big/int_test.go
index 6070cf3..2d762db 100644
--- a/libgo/go/math/big/int_test.go
+++ b/libgo/go/math/big/int_test.go
@@ -1201,6 +1201,7 @@ var bitwiseTests = []struct {
{"-0x01", "-0x01", "-0x01", "-0x01", "0x00", "0x00"},
{"0x07", "0x08", "0x00", "0x0f", "0x0f", "0x07"},
{"0x05", "0x0f", "0x05", "0x0f", "0x0a", "0x00"},
+ {"0xff", "-0x0a", "0xf6", "-0x01", "-0xf7", "0x09"},
{"0x013ff6", "0x9a4e", "0x1a46", "0x01bffe", "0x01a5b8", "0x0125b0"},
{"-0x013ff6", "0x9a4e", "0x800a", "-0x0125b2", "-0x01a5bc", "-0x01c000"},
{"-0x013ff6", "-0x9a4e", "-0x01bffe", "-0x1a46", "0x01a5b8", "0x8008"},