summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/bignum.c b/bignum.c
index 5eef0b0d6b..cfad1b11f7 100644
--- a/bignum.c
+++ b/bignum.c
@@ -874,10 +874,7 @@ rb_int_import(int sign, const void *words, size_t wordcount, int wordorder, size
if (sign != 1 && sign != 0 && sign != -1)
rb_raise(rb_eArgError, "unexpected sign: %d", sign);
- /*
- * num_bits = (wordsize * CHAR_BIT - nails) * count
- * num_bdigits = (num_bits + SIZEOF_BDIGITS*CHAR_BIT - 1) / (SIZEOF_BDIGITS*CHAR_BIT)
- */
+ /* num_bits = (wordsize * CHAR_BIT - nails) * count */
num_bits = SIZET2NUM(wordsize);
num_bits = rb_funcall(num_bits, '*', 1, LONG2FIX(CHAR_BIT));
num_bits = rb_funcall(num_bits, '-', 1, SIZET2NUM(nails));
@@ -886,6 +883,7 @@ rb_int_import(int sign, const void *words, size_t wordcount, int wordorder, size
if (num_bits == LONG2FIX(0))
return LONG2FIX(0);
+ /* num_bdigits = (num_bits + SIZEOF_BDIGITS*CHAR_BIT - 1) / (SIZEOF_BDIGITS*CHAR_BIT) */
num_bdigits = rb_funcall(num_bits, '+', 1, LONG2FIX(SIZEOF_BDIGITS*CHAR_BIT-1));
num_bdigits = rb_funcall(num_bdigits, '/', 1, LONG2FIX(SIZEOF_BDIGITS*CHAR_BIT));