summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--bignum.c6
-rw-r--r--object.c2
3 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index eae64fc3b2..7024132e83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,13 @@ Fri Oct 4 13:05:58 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/extmk.rb (create_makefile): add -Wl,-no-undefined to $DLDFLAGS
on Linux if GNU ld is used and --enable-shared is specified.
+Fri Oct 4 02:21:16 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * bignum.c (rb_big_rshift): num should be initialized by carry
+ bits if x is negative.
+
+ * bignum.c (bigdivmod): len for bignum zero is 1, not 0.
+
Thu Oct 3 20:22:11 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* bcc32/mkexports.rb: to work on cygwin via telnet.
diff --git a/bignum.c b/bignum.c
index 537852d959..4db4bdb6a6 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1243,7 +1243,8 @@ bigdivmod(x, y, divp, modp)
VALUE mod;
bigdivrem(x, y, divp, &mod);
- if (RBIGNUM(x)->sign != RBIGNUM(y)->sign && RBIGNUM(mod)->len > 0) {
+ if (RBIGNUM(x)->sign != RBIGNUM(y)->sign &&
+ RBIGNUM(mod)->len > 0 && BDIGITS(mod)[0] != 0) {
if (divp) *divp = bigadd(*divp, rb_int2big(1), 0);
if (modp) *modp = bigadd(mod, y, 1);
}
@@ -1603,6 +1604,9 @@ rb_big_rshift(x, y)
xds = BDIGITS(x);
i = RBIGNUM(x)->len; j = i - s1;
z = bignew(j, RBIGNUM(x)->sign);
+ if (!RBIGNUM(x)->sign) {
+ num = ((BDIGIT_DBL)~0) << BITSPERDIG;
+ }
zds = BDIGITS(z);
while (i--, j--) {
num = (num | xds[i]) >> s2;
diff --git a/object.c b/object.c
index 455d353b39..72805e9d67 100644
--- a/object.c
+++ b/object.c
@@ -87,7 +87,7 @@ VALUE
rb_obj_type(obj)
VALUE obj;
{
- rb_warn("`type' is deprecated; use `class'");
+ rb_warn("Object#type is deprecated; use Object#class");
return rb_class_real(CLASS_OF(obj));
}