* 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
This commit is contained in:
akr 2013-06-25 12:51:17 +00:00
parent 448c66c516
commit 7565d728b6
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Tue Jun 25 21:43:13 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (big2dbl): Use (BDIGIT)1 instead of 1UL.
(bary_mul_normal): Remove a useless cast.
Tue Jun 25 21:26:00 2013 Kenta Murata <mrkn@mrkn.jp>
* ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix for the cases when

View File

@ -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);