From c13ca745209883e1d68bda80d9a1a2c9d2a932d8 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 25 May 2003 14:48:26 +0000 Subject: [PATCH] * bignum.c (rb_quad_pack): should negate negative bignum. (ruby-bugs-ja:PR#474) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ bignum.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2ed7a864e5..91306648ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun May 25 23:48:21 2003 Nobuyoshi Nakada + + * bignum.c (rb_quad_pack): should negate negative bignum. + (ruby-bugs-ja:PR#474) + Sun May 25 03:27:25 2003 Minero Aoki * lib/net/smtp.rb: support LOGIN authentication, based on diff --git a/bignum.c b/bignum.c index 01c882476e..5992662d42 100644 --- a/bignum.c +++ b/bignum.c @@ -206,6 +206,7 @@ rb_quad_pack(buf, val) q = BIGUP(q); q += ds[len]; } + if (!RBIGNUM(val)->sign) q = -q; } memcpy(buf, (char*)&q, SIZEOF_LONG_LONG); }