diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-07 12:16:32 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-07 12:16:32 +0000 |
commit | 07b72b8c856353096fad39a7f628e9076533dc18 (patch) | |
tree | 0081654d8730afde63d9813dd4f84717e49c1201 /bignum.c | |
parent | 8f7a3075881cc057fa70639729e0073a12bfe55c (diff) | |
download | ruby-07b72b8c856353096fad39a7f628e9076533dc18.tar.gz |
Update comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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)); |