From ef91e0fd329e18d657f18e3ffb38d82aea31f32b Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Tue, 16 Nov 2004 19:43:24 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bignum.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bignum.c') diff --git a/bignum.c b/bignum.c index 06228416b..aba88df04 100644 --- a/bignum.c +++ b/bignum.c @@ -747,6 +747,17 @@ big2ulong(x, type) return num; } +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; -- cgit