diff options
author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-16 19:43:24 +0000 |
---|---|---|
committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-16 19:43:24 +0000 |
commit | b86269e445e85cb6a7fdfb6361328004d20caadc (patch) | |
tree | a8cd9194798196df8db9caeadbab7eb255a5feba /bignum.c | |
parent | 73deb733926e8b4cf58949141d11a1083911f227 (diff) |
* pack.c: all features are backport from 1.9. [ruby-dev:24826]
* bignum.c (rb_big2ulong_pack): new function to pack Bignums.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -748,6 +748,17 @@ big2ulong(x, type) } unsigned long +rb_big2ulong_pack(x) + VALUE x; +{ + unsigned long num = big2ulong(x, "unsigned long", Qfalse); + if (!RBIGNUM(x)->sign) { + return -num; + } + return num; +} + +unsigned long rb_big2ulong(x) VALUE x; { |