From 25836893406be62419cb65c07497b03a756c22a6 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 3 Sep 2013 11:20:02 +0000 Subject: * bignum.c (GMP_STR2BIG_DIGITS): New macro. (str2big_gmp): New function. (rb_cstr_to_inum): Use str2big_gmp for big bignums. (rb_str2big_gmp): New function. * internal.h (rb_str2big_gmp): Declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/bignum/test_str2big.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/-ext-/bignum/test_str2big.rb') diff --git a/test/-ext-/bignum/test_str2big.rb b/test/-ext-/bignum/test_str2big.rb index ac55c78082..f77641b350 100644 --- a/test/-ext-/bignum/test_str2big.rb +++ b/test/-ext-/bignum/test_str2big.rb @@ -26,5 +26,12 @@ class TestBignum < Test::Unit::TestCase assert_equal(n, s.str2big_karatsuba(10, true)) end + def test_str2big_gmp + s = "1" + "0" * 1000 + n = 10 ** 1000 + assert_equal(n, s.str2big_gmp(10, true)) + rescue NotImplementedError + end + end end -- cgit v1.2.3