summaryrefslogtreecommitdiff
path: root/test/-ext-
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 11:20:02 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 11:20:02 +0000
commit25836893406be62419cb65c07497b03a756c22a6 (patch)
tree0ae0dbc01672c8c96dcb07660371f59232748103 /test/-ext-
parent1b126277edef6d2e9a5cd8d4113a98c74964338a (diff)
* 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
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/bignum/test_str2big.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/-ext-/bignum/test_str2big.rb b/test/-ext-/bignum/test_str2big.rb
index ac55c78..f77641b 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