mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1e3062ede1
commit
a2c9020808
3 changed files with 13 additions and 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.
|
||||
|
|
6
bignum.c
6
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;
|
||||
|
|
2
object.c
2
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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue