summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-01 01:00:15 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-01 01:00:15 +0000
commita0a0b61b68e77f47faa80933682127fb6c6e290f (patch)
tree7b337de067dc21573d131508899620520fd021d7 /bignum.c
parent7bb549d6b597b581a2f95496928612f2059e2df2 (diff)
[DOC]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index b0159ecc46..6c65cae40e 100644
--- a/bignum.c
+++ b/bignum.c
@@ -6545,6 +6545,8 @@ rb_big_size(VALUE big)
* (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)
* (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