mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* include/ruby/ruby.h (struct RBignum): embed digits in RBignum for
small bignums. * bignum.c: RBignum embeded digits implemented. * include/ruby/intern.h: declare rb_big_resize. * gc.c: don't free embedded digits. * numeric.c: replace direct bignum field accessor by abstract field accessor such as RBIGNUM(val)->sign to RBIGNUM_SIGN(val). * sprintf.c: ditto. * compar.c: ditto. * marshal.c: ditto. * random.c: ditto. * .gdbinit: support embedded small bignums. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0c5e6ab2bb
commit
2c8e7a50c1
12 changed files with 332 additions and 203 deletions
|
@ -2,6 +2,12 @@ require 'test/unit'
|
|||
|
||||
class TestInteger < Test::Unit::TestCase
|
||||
VS = [
|
||||
-0x1000000000000000000000000000000000000000000000002,
|
||||
-0x1000000000000000000000000000000000000000000000001,
|
||||
-0x1000000000000000000000000000000000000000000000000,
|
||||
-0x1000000000000000000000002,
|
||||
-0x1000000000000000000000001,
|
||||
-0x1000000000000000000000000,
|
||||
-0x10000000000000002,
|
||||
-0x10000000000000001,
|
||||
-0x10000000000000000,
|
||||
|
@ -89,6 +95,12 @@ class TestInteger < Test::Unit::TestCase
|
|||
0xffffffffffffffff,
|
||||
0x10000000000000000,
|
||||
0x10000000000000001,
|
||||
0xffffffffffffffffffffffff,
|
||||
0x1000000000000000000000000,
|
||||
0x1000000000000000000000001,
|
||||
0xffffffffffffffffffffffffffffffffffffffffffffffff,
|
||||
0x1000000000000000000000000000000000000000000000000,
|
||||
0x1000000000000000000000000000000000000000000000001
|
||||
]
|
||||
|
||||
#VS.map! {|v| 0x4000000000000000.coerce(v)[0] }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue