summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 10:35:25 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 10:35:25 +0000
commit979153cf9b89f534b01fd538a60265d868bd9020 (patch)
tree87057d5ebd352ba4fde53ab633222f63c90a4ddd /bignum.c
parent4c52c1c5edd7de3af0c06f610920c17b63fcebf0 (diff)
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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/bignum.c b/bignum.c
index 0d7fe2bcda..4642bb5380 100644
--- a/bignum.c
+++ b/bignum.c
@@ -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;
}
/*