ruby-changes:29094
From: akr <ko1@a...>
Date: Fri, 7 Jun 2013 21:16:50 +0900 (JST)
Subject: [ruby-changes:29094] akr:r41146 (trunk): Update comment.
akr 2013-06-07 21:16:32 +0900 (Fri, 07 Jun 2013) New Revision: 41146 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41146 Log: Update comment. Modified files: trunk/bignum.c Index: bignum.c =================================================================== --- bignum.c (revision 41145) +++ bignum.c (revision 41146) @@ -874,10 +874,7 @@ rb_int_import(int sign, const void *word https://github.com/ruby/ruby/blob/trunk/bignum.c#L874 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 *word https://github.com/ruby/ruby/blob/trunk/bignum.c#L883 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)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/