ruby-changes:30672
From: akr <ko1@a...>
Date: Sun, 1 Sep 2013 10:00:19 +0900 (JST)
Subject: [ruby-changes:30672] akr:r42751 (trunk): [DOC]
akr 2013-09-01 10:00:15 +0900 (Sun, 01 Sep 2013) New Revision: 42751 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42751 Log: [DOC] Modified files: trunk/bignum.c Index: bignum.c =================================================================== --- bignum.c (revision 42750) +++ bignum.c (revision 42751) @@ -6545,6 +6545,8 @@ rb_big_size(VALUE big) https://github.com/ruby/ruby/blob/trunk/bignum.c#L6545 * (The bit position of the bit 2**n is n+1.) * If there is no such bit (zero or minus one), zero is returned. * + * I.e. This method returns ceil(log2(int < 0 ? -int : int+1)). + * * (-2**10000-1).bit_length #=> 10001 * (-2**10000).bit_length #=> 10000 * (-2**10000+1).bit_length #=> 10000 @@ -6615,6 +6617,8 @@ rb_big_bit_length(VALUE big) https://github.com/ruby/ruby/blob/trunk/bignum.c#L6617 * (The bit position of the bit 2**n is n+1.) * If there is no such bit (zero or minus one), zero is returned. * + * I.e. This method returns ceil(log2(int < 0 ? -int : int+1)). + * * (-2**12-1).bit_length #=> 13 * (-2**12).bit_length #=> 12 * (-2**12+1).bit_length #=> 12 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/