ruby-changes:1682
From: ko1@a...
Date: 22 Aug 2007 10:11:41 +0900
Subject: [ruby-changes:1682] shyouhei - Ruby:r13172 (ruby_1_8_6): * bignum.c (rb_big_neg): SIGNED_VALUE isn't in 1.8.
shyouhei 2007-08-22 10:11:29 +0900 (Wed, 22 Aug 2007) New Revision: 13172 Modified files: branches/ruby_1_8_6/ChangeLog branches/ruby_1_8_6/bignum.c branches/ruby_1_8_6/version.h Log: * bignum.c (rb_big_neg): SIGNED_VALUE isn't in 1.8. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ChangeLog?r1=13172&r2=13171 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=13172&r2=13171 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/bignum.c?r1=13172&r2=13171 Index: ruby_1_8_6/ChangeLog =================================================================== --- ruby_1_8_6/ChangeLog (revision 13171) +++ ruby_1_8_6/ChangeLog (revision 13172) @@ -1,3 +1,9 @@ +Wed Aug 22 10:07:48 2007 Nobuyoshi Nakada <nobu@r...> + + * bignum.c (rb_big_neg): SIGNED_VALUE isn't in 1.8. + + * bignum.c (bigtrunc): do not empty Bignum. [ruby-dev:31229] + Wed Aug 22 10:02:42 2007 Yukihiro Matsumoto <matz@r...> * numeric.c (fix_pow): 0**2 should not raise floating point Index: ruby_1_8_6/version.h =================================================================== --- ruby_1_8_6/version.h (revision 13171) +++ ruby_1_8_6/version.h (revision 13172) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2007-08-22" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20070822 -#define RUBY_PATCHLEVEL 60 +#define RUBY_PATCHLEVEL 63 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 Index: ruby_1_8_6/bignum.c =================================================================== --- ruby_1_8_6/bignum.c (revision 13171) +++ ruby_1_8_6/bignum.c (revision 13172) @@ -74,6 +74,7 @@ BDIGIT *ds = BDIGITS(x); BDIGIT_DBL num; + if (!i) return; while (i--) ds[i] = ~ds[i]; i = 0; num = 1; do { @@ -102,7 +103,7 @@ long len = RBIGNUM(x)->len; BDIGIT *ds = BDIGITS(x); - while (len-- && !ds[len]); + while (--len && !ds[len]); RBIGNUM(x)->len = ++len; return x; } @@ -1086,6 +1087,7 @@ if (!RBIGNUM(x)->sign) get2comp(z); ds = BDIGITS(z); i = RBIGNUM(x)->len; + if (!i) return INT2FIX(~0); while (i--) ds[i] = ~ds[i]; RBIGNUM(z)->sign = !RBIGNUM(z)->sign; if (RBIGNUM(x)->sign) get2comp(z); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml