]> Cypherpunks repositories - gostls13.git/commit
big: use fast shift routines
authorRobert Griesemer <gri@golang.org>
Sat, 1 May 2010 04:25:48 +0000 (21:25 -0700)
committerRobert Griesemer <gri@golang.org>
Sat, 1 May 2010 04:25:48 +0000 (21:25 -0700)
commit58e77990ba20494b8a4837f3668f8f03281e5406
treeb4dc96c2c2b707063c3557bc6b2e92645dfb6f62
parent161b44c76a78ea2b2f04d8c3ba8c8292edac54b4
big: use fast shift routines

- fixed a couple of bugs in the process
  (shift right was incorrect for negative numbers)
- added more tests and made some tests more robust
- changed pidigits back to using shifts to multiply
  by 2 instead of add

  This improves pidigit -s -n 10000 by approx. 5%:

  user 0m6.496s (old)
  user 0m6.156s (new)

R=rsc
CC=golang-dev
https://golang.org/cl/963044
src/pkg/big/int.go
src/pkg/big/int_test.go
src/pkg/big/nat.go
src/pkg/big/nat_test.go
test/bench/pidigits.go