summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--bignum.c4
-rw-r--r--version.h2
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 32803df..96573b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Aug 22 10:07:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* numeric.c (fix_pow): 0**2 should not raise floating point
diff --git a/bignum.c b/bignum.c
index 0beecd4..7fb48f5 100644
--- a/bignum.c
+++ b/bignum.c
@@ -74,6 +74,7 @@ get2comp(x)
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 @@ bigtrunc(x)
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 @@ rb_big_neg(x)
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);
diff --git a/version.h b/version.h
index 56e41b8..216e965 100644
--- a/version.h
+++ b/version.h
@@ -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