]> Cypherpunks repositories - gostls13.git/commit
big: completed set of Int division routines & cleanups
authorRobert Griesemer <gri@golang.org>
Tue, 4 May 2010 01:48:05 +0000 (18:48 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 4 May 2010 01:48:05 +0000 (18:48 -0700)
commitb9caa4ac56f306e4195dcbf5db1afd831a6049fa
tree3af01de8de8d4c9953f46e138dd8b99d55dbf579
parent32df67889433b43f0e20c89dec5a8f88920bddcf
big: completed set of Int division routines & cleanups

- renamed Len -> BitLen, simplified implementation
- renamed old Div, Mod, DivMod -> Que, Rem, QuoRem
- implemented Div, Mod, DivMod (Euclidian definition, more
  useful in a mathematical context)
- fixed a bug in Exp (-0 was possible)
- added extra tests to check normalized results everywhere
- uniformly set Int.neg flag at the end of computations
- minor cosmetic cleanups
- ran all tests

R=rsc
CC=golang-dev
https://golang.org/cl/1091041
src/pkg/big/int.go
src/pkg/big/int_test.go
src/pkg/big/nat.go
src/pkg/bignum/integer.go
src/pkg/crypto/rsa/pkcs1v15.go
src/pkg/crypto/rsa/pkcs1v15_test.go
src/pkg/crypto/rsa/rsa.go
test/bench/pidigits.go