summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 00:31:59 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 00:31:59 +0000
commit3799f1bbd8986c4e98ec397d2dc7ecfc33f84b98 (patch)
tree28532eb497c5ea15ec1ca9948299ae055a626cb2 /bignum.c
parent1d18ec7ea69739b9bb9b5059b1dfdd36c3643d68 (diff)
merge revision(s) 23740:
* bignum.c (big_lshift, big_rshift): return Bignum always withou normalization. [ruby-dev:38680] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bignum.c b/bignum.c
index 7f14aee709..8e27369090 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2038,8 +2038,8 @@ rb_big_lshift(x, y)
y = rb_to_int(y);
}
- if (neg) return big_rshift(x, shift);
- return big_lshift(x, shift);
+ x = neg ? big_rshift(x, shift) : big_lshift(x, shift);
+ return bignorm(x);
}
static VALUE
@@ -2067,7 +2067,7 @@ big_lshift(x, shift)
num = BIGDN(num);
}
*zds = BIGLO(num);
- return bignorm(z);
+ return z;
}
/*
@@ -2107,8 +2107,8 @@ rb_big_rshift(x, y)
y = rb_to_int(y);
}
- if (neg) return big_lshift(x, shift);
- return big_rshift(x, shift);
+ x = neg ? big_lshift(x, shift) : big_rshift(x, shift);
+ return bignorm(x);
}
static VALUE
@@ -2153,7 +2153,7 @@ big_rshift(x, shift)
if (!RBIGNUM(x)->sign) {
get2comp(z);
}
- return bignorm(z);
+ return z;
}
/*