diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | bignum.c | 6 | ||||
-rw-r--r-- | object.c | 2 |
3 files changed, 13 insertions, 2 deletions
@@ -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. @@ -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; @@ -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)); } |