summaryrefslogtreecommitdiff
path: root/src/pkg/big/nat_test.go
AgeCommit message (Collapse)AuthorFilesLines
2011-09-13Imported Upstream version 60upstream/60Ondřej Surý1-0/+669
2011-09-13Imported Upstream version 60Ondřej Surý1-729/+0
2011-06-30Imported Upstream version 58upstream/58Ondřej Surý1-21/+392
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-87/+75
2010-05-15big: implemented format support for fmt library, MulRangeRobert Griesemer1-17/+17
- support for binary prefix 0b (to match fmt.Format) - renamed nat.new -> nat.setUint64 for consistency - more tests R=r CC=golang-dev http://codereview.appspot.com/1233041 Committer: Robert Griesemer <gri@golang.org>
2010-05-03big: Add bitwise methods for IntEvan Shaw1-11/+11
R=gri CC=golang-dev http://codereview.appspot.com/987041 Committer: Robert Griesemer <gri@golang.org>
2010-05-01big: cleanup and removal of redundant functionalityRobert Griesemer1-4/+4
R=rsc CC=golang-dev http://codereview.appspot.com/1048041
2010-04-30big: use fast shift routinesRobert Griesemer1-19/+17
- 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 http://codereview.appspot.com/963044
2010-04-30big: improved computation of "karatsuba length" for faster multipliesRobert Griesemer1-6/+10
This results in an improvement of > 35% for the existing Mul benchmark using the same karatsuba threshold, and an improvement of > 50% with a slightly higher threshold (32 instead of 30): big.BenchmarkMul 500 6731846 ns/op (old alg.) big.BenchmarkMul 500 4351122 ns/op (new alg.) big.BenchmarkMul 500 3133782 ns/op (new alg., new theshold) Also: - tweaked calibrate.go, use same benchmark as for Mul benchmark R=rsc CC=golang-dev http://codereview.appspot.com/1037041
2010-04-27big: implemented Karatsuba multiplicationRobert Griesemer1-0/+58
Plus: - calibration "test" - include in tests with gotest -calibrate - basic Mul benchmark - extra multiplication tests - various cleanups This change improves multiplication speed of numbers >= 30 words in length (current threshold; found empirically with calibrate): The multiplication benchmark (multiplication of a variety of long numbers) improves by ~35%, individual multiplies can be significantly faster. gotest -benchmarks=Mul big.BenchmarkMul 500 6829290 ns/op (w/ Karatsuba) big.BenchmarkMul 100 10600760 ns/op There's no impact on pidigits for -n=10000 or -n=20000 because the operands are are too small. R=rsc CC=golang-dev http://codereview.appspot.com/1004042 Committer: Robert Griesemer <gri@golang.org>
2010-04-22big: Create type natEvan Shaw1-91/+91
Changed most of the functions in nat.go to methods on nat. R=gri CC=golang-dev http://codereview.appspot.com/976041 Committer: Robert Griesemer <gri@golang.org>
2010-04-21big: Add some testsEvan Shaw1-1/+30
R=rsc, gri CC=golang-dev http://codereview.appspot.com/967041 Committer: Robert Griesemer <gri@golang.org>
2010-04-20big: Add Lsh and Value; convert pidigits to use bigEvan Shaw1-1/+1
This yields a pretty significant performance boost to pidigits and there are still some improvements to be made. Here are my numbers: amd64 w/ bignum: pidigits 10000 gcc -O2 pidigits.c -lgmp 2.10u 0.00s 2.10r gc pidigits 22.92u 0.02s 22.97r gc_B pidigits 22.62u 0.00s 22.65r amd64 w/ big: pidigits 10000 gcc -O2 pidigits.c -lgmp 2.09u 0.02s 2.11r gc pidigits 12.68u 0.04s 12.72r gc_B pidigits 12.71u 0.03s 12.75r 386 w/ bignum: pidigits 10000 gcc -O2 pidigits.c -lgmp 2.09u 0.00s 2.09r gc pidigits 44.30u 0.01s 44.35r gc_B pidigits 44.29u 0.03s 44.35r 386 w/ big: pidigits 10000 gcc -O2 pidigits.c -lgmp 2.10u 0.00s 2.10r gc pidigits 22.70u 0.06s 22.79r gc_B pidigits 22.80u 0.09s 22.91r R=rsc, gri CC=golang-dev http://codereview.appspot.com/881050 Committer: Russ Cox <rsc@golang.org>
2009-12-15 1) Change default gofmt default settings forRobert Griesemer1-50/+50
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 1st set of files. R=rsc CC=agl, golang-dev, iant, ken2, r http://codereview.appspot.com/180047
2009-11-11Reland a112249da741, this time with missing file.Adam Langley1-1/+95
2009-11-11roll back 3985: build is brokenRuss Cox1-95/+1
TBR=agl1 CC=golang-dev http://codereview.appspot.com/154065
2009-11-11big:Adam Langley1-1/+95
Turn methods that don't store the result in their receiver into functions in order to preserve the convention. Re-jig Exp and Div by moving their guts into nat.go. Add ProbablyPrime to perform Miller-Rabin primality tests. crypto/rsa: reenable key generation since we now have ProbablyPrime. R=gri CC=go-dev http://codereview.prom.corp.google.com/1024038
2009-11-09- replaced gofmt expression formatting algorithm withRobert Griesemer1-8/+8
rsc's algorithm - applied gofmt -w misc src - partial CL (remaining files in other CLs) R=rsc, r http://go/go-review/1024040
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-7/+7
R=rsc, r http://go/go-review/1025029
2009-11-05big: add Div, Mod, Exp, GcdExt and several other fixes.Adam Langley1-1/+74
R=gri, rsc CC=go-dev http://go/go-review/1017036
2009-10-06another round of gofmt applicationsRuss Cox1-0/+1
R=gri DELTA=900 (106 added, 31 deleted, 763 changed) OCL=35384 CL=35396
2009-10-06apply gofmt to the LGTM-marked files from 34501Russ Cox1-5/+11
that have not changed since I applied gofmt. R=gri DELTA=456 (77 added, 3 deleted, 376 changed) OCL=35378 CL=35383
2009-08-18- implemented MultiplicationRobert Griesemer1-0/+19
- changed Cmp to return -1, 0, +1 - added corresponding test cases R=rsc DELTA=173 (136 added, 3 deleted, 34 changed) OCL=33431 CL=33459
2009-08-17- rename files to match the data types they implement, adusted MakefileRobert Griesemer1-0/+88
- no other changes R=r DELTA=1248 (623 added, 623 deleted, 2 changed) OCL=33371 CL=33371