From ffe55cdc1e2b18ff5f45b556043eecd672675ec6 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 8 Jul 2013 11:56:55 +0000 Subject: * 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 --- test/-ext-/bignum/test_mul.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/-ext-') 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 -- cgit v1.2.3