mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[DOC]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
09e6766d1a
commit
2fee22f30d
2 changed files with 15 additions and 0 deletions
7
bignum.c
7
bignum.c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue