diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-08 11:56:55 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-08 11:56:55 +0000 |
commit | ffe55cdc1e2b18ff5f45b556043eecd672675ec6 (patch) | |
tree | f5694aa74d06743441ed23dcf170d12edace152c /test | |
parent | ed92ae818f7b14690c401e07c1bdaa0746972cb5 (diff) | |
download | ruby-ffe55cdc1e2b18ff5f45b556043eecd672675ec6.tar.gz |
* bignum.c (bary_mul_balance): Reduce work memory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/-ext-/bignum/test_mul.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/-ext-/bignum/test_mul.rb b/test/-ext-/bignum/test_mul.rb index 539b9cf138..e125401664 100644 --- a/test/-ext-/bignum/test_mul.rb +++ b/test/-ext-/bignum/test_mul.rb @@ -43,6 +43,18 @@ class TestBignum < Test::Unit::TestCase assert_equal(z, x.big_mul_balance(y)) end + def test_mul_balance_2x16 + x = (1 << Bignum::BITSPERDIG) | 1 + y = (1 << Bignum::BITSPERDIG*16) | 1 + assert_equal(x.big_mul_normal(y), x.big_mul_balance(y)) + end + + def test_mul_balance_2x17 + x = (1 << Bignum::BITSPERDIG) | 1 + y = (1 << Bignum::BITSPERDIG*17) | 1 + assert_equal(x.big_mul_normal(y), x.big_mul_balance(y)) + end + def test_mul_karatsuba x = (1 << BITSPERDIG) | 1 y = (1 << BITSPERDIG) | 1 |