]> Cypherpunks repositories - gostls13.git/commit
math/big: bug in AndNot(x,y) for x>0,y<0.
authorKeith Randall <khr@golang.org>
Fri, 16 Jan 2015 04:45:07 +0000 (20:45 -0800)
committerKeith Randall <khr@golang.org>
Fri, 16 Jan 2015 17:36:29 +0000 (17:36 +0000)
commitc6ddca2aec4218e1af7f51fad3b761afb33b4c20
tree62052e3e748796b844a5778978e511ca9ea76b8e
parente10e913d08b6eb53b81f18ea9fc7b7caaf599b4a
math/big: bug in AndNot(x,y) for x>0,y<0.

The comment says to use (y-1), but then we did add(y.abs, natOne).  We meant sub.

Fixes #9609

Change-Id: I4fe4783326ca082c05588310a0af7895a48fc779
Reviewed-on: https://go-review.googlesource.com/2961
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/big/int.go
src/math/big/int_test.go