aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-25 12:51:17 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-25 12:51:17 +0000
commit7565d728b6f3910cf41ce106bf0b7bc2aef2bc77 (patch)
tree9c599f28d239085d026626c551b8a3f5c29d2b30 /bignum.c
parent448c66c5162259ba734ea16b9c300d762cc63914 (diff)
downloadruby-7565d728b6f3910cf41ce106bf0b7bc2aef2bc77.tar.gz
* bignum.c (big2dbl): Use (BDIGIT)1 instead of 1UL.
(bary_mul_normal): Remove a useless cast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bignum.c b/bignum.c
index 9760d0b455..65ba7790f2 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2618,7 +2618,7 @@ big2dbl(VALUE x)
d = ds[i] + BIGRAD*d;
}
dl = ds[i];
- if (bits && (dl & (1UL << (bits %= BITSPERDIG)))) {
+ if (bits && (dl & ((BDIGIT)1 << (bits %= BITSPERDIG)))) {
int carry = (dl & ~(BDIGMAX << bits)) != 0;
if (!carry) {
while (i-- > 0) {
@@ -3386,7 +3386,7 @@ bary_mul_normal(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, siz
if (dd == 0) continue;
n = 0;
for (j = 0; j < yl; j++) {
- BDIGIT_DBL ee = n + (BDIGIT_DBL)dd * yds[j];
+ BDIGIT_DBL ee = n + dd * yds[j];
n = zds[i + j] + ee;
if (ee) zds[i + j] = BIGLO(n);
n = BIGDN(n);