1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-02-11 16:40:41 +00:00
parent 09e6766d1a
commit 2fee22f30d
2 changed files with 15 additions and 0 deletions

View file

@ -6999,6 +6999,13 @@ rb_big_size(VALUE big)
* (2**10000).bit_length #=> 10001
* (2**10000+1).bit_length #=> 10001
*
* This method can be used to detect overflow in Array#pack as follows.
*
* if n.bit_length < 32
* [n].pack("l") # no overflow
* else
* raise "overflow"
* end
*/
static VALUE

View file

@ -3538,6 +3538,14 @@ fix_size(VALUE fix)
* (2**12-1).bit_length #=> 12
* (2**12).bit_length #=> 13
* (2**12+1).bit_length #=> 13
*
* This method can be used to detect overflow in Array#pack as follows.
*
* if n.bit_length < 32
* [n].pack("l") # no overflow
* else
* raise "overflow"
* end
*/
static VALUE