diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-21 10:09:34 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-21 10:09:34 +0000 |
commit | 6e19e1b87657d12d4e6fe2257462287ebcf67d40 (patch) | |
tree | 43878c9f18dd3f63e4911e52f7a7bc5d4a5c32fd /bignum.c | |
parent | 372272c24517801813390f0a1284703db9b2a79c (diff) | |
download | ruby-6e19e1b87657d12d4e6fe2257462287ebcf67d40.tar.gz |
* bignum.c (bigsub_int): Use bdigit_roomof.
(bigadd_int): Ditto.
(bigand_int): Ditto.
(bigor_int): Ditto.
(bigxor_int): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -2975,7 +2975,7 @@ bigsub_int(VALUE x, long y0) i = 1; #else num = 0; - for (i=0; i<(int)(sizeof(y)/SIZEOF_BDIGITS); i++) { + for (i=0; i<bdigit_roomof(SIZEOF_LONG); i++) { num += (BDIGIT_DBL_SIGNED)xds[i] - BIGLO(y); zds[i] = BIGLO(num); num = BIGDN(num); @@ -3026,7 +3026,7 @@ bigadd_int(VALUE x, long y) i = 1; #else num = 0; - for (i=0; i<(int)(sizeof(y)/SIZEOF_BDIGITS); i++) { + for (i=0; i<bdigit_roomof(SIZEOF_LONG); i++) { num += (BDIGIT_DBL)xds[i] + BIGLO(y); zds[i] = BIGLO(num); num = BIGDN(num); @@ -4439,7 +4439,7 @@ bigand_int(VALUE x, long y) { BDIGIT_DBL num = y; - for (i=0; i<(int)(sizeof(y)/SIZEOF_BDIGITS); i++) { + for (i=0; i<bdigit_roomof(SIZEOF_LONG); i++) { zds[i] = xds[i] & BIGLO(num); num = BIGDN(num); } @@ -4535,7 +4535,7 @@ bigor_int(VALUE x, long y) { BDIGIT_DBL num = y; - for (i=0; i<(int)(sizeof(y)/SIZEOF_BDIGITS); i++) { + for (i=0; i<bdigit_roomof(SIZEOF_LONG); i++) { zds[i] = xds[i] | BIGLO(num); num = BIGDN(num); } @@ -4631,7 +4631,7 @@ bigxor_int(VALUE x, long y) { BDIGIT_DBL num = y; - for (i=0; i<(int)(sizeof(y)/SIZEOF_BDIGITS); i++) { + for (i=0; i<bdigit_roomof(SIZEOF_LONG); i++) { zds[i] = xds[i] ^ BIGLO(num); num = BIGDN(num); } |