From 54c3b1ba19793f8735f1b99dbc964995bb903e17 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 2 Aug 2013 14:53:22 +0000 Subject: * bignum.c (power_cache_get_power): Appry bigtrunc to the result of bigsq. (big2str_karatsuba): Fix number of leading zero characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_bignum.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index 95c5dd784a..c2f8738246 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -106,6 +106,8 @@ class TestBignum < Test::Unit::TestCase assert_equal("nd075ib45k86g" ,18446744073709551616.to_s(31), "[ruby-core:10686]") assert_equal("1777777777777777777777" ,18446744073709551615.to_s(8)) assert_equal("-1777777777777777777777" ,-18446744073709551615.to_s(8)) + assert_match(/\A10{99}1\z/, (10**100+1).to_s) + assert_match(/\A10{900}9{100}\z/, (10**1000+(10**100-1)).to_s) end b = 2**64 -- cgit v1.2.3