diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-21 10:35:25 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-21 10:35:25 +0000 |
commit | d5e9170d6a2927a0837f4bdc31c1fefd711674b2 (patch) | |
tree | 87057d5ebd352ba4fde53ab633222f63c90a4ddd /bignum.c | |
parent | 1002dfb5131c5ebe352df7540481f61fd1105d28 (diff) | |
download | ruby-d5e9170d6a2927a0837f4bdc31c1fefd711674b2.tar.gz ruby-d5e9170d6a2927a0837f4bdc31c1fefd711674b2.tar.xz ruby-d5e9170d6a2927a0837f4bdc31c1fefd711674b2.zip |
merges r23739 from trunk into ruby_1_9_1.
--
* bignum.c (big_lshift, big_rshift): return Bignum always without
normalization. [ruby-dev:38679]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1981,7 +1981,7 @@ static VALUE big_shift(VALUE x, int n) /* * call-seq: - * big.fdiv(numeric) -> float + * big.fdiv(numeric) -> float * * Returns the floating point result of dividing <i>big</i> by * <i>numeric</i>. @@ -2383,8 +2383,8 @@ rb_big_lshift(VALUE x, VALUE 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 @@ -2410,7 +2410,7 @@ big_lshift(VALUE x, unsigned long shift) num = BIGDN(num); } *zds = BIGLO(num); - return bignorm(z); + return z; } /* @@ -2449,8 +2449,8 @@ rb_big_rshift(VALUE x, VALUE 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 @@ -2493,7 +2493,7 @@ big_rshift(VALUE x, unsigned long shift) if (!RBIGNUM_SIGN(x)) { get2comp(z); } - return bignorm(z); + return z; } /* |