mruby-numeric-ext: add call-seq reference for Integer#size

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-07-10 14:56:13 +09:00
parent ee296f024b
commit c75f7587bc
@@ -200,6 +200,21 @@ int_digits(mrb_state *mrb, mrb_value self)
return digits;
}
/*
* call-seq:
* int.size -> int
*
* Returns the number of bytes in the machine representation of int
* (machine dependent).
*
* 1.size #=> 8
* -1.size #=> 8
* 2147483647.size #=> 8
* (256**10 - 1).size #=> 12
* (256**20 - 1).size #=> 20
* (256**40 - 1).size #=> 40
*/
static mrb_value
int_size(mrb_state *mrb, mrb_value self)
{