Implement Integer#bit_length in mrbgems/mruby-numeric-ext.
- Fixnum: zero returns 0; negatives follow ~self rule; count bits by shifts.
- Bigint (MRB_USE_BIGINT): handle sign; negatives via mrb_bint_rev, then bit
length via length of mrb_bint_to_s(..., 2).
- Add tests in mrbgems/mruby-numeric-ext/test/numeric.rb.
- Update README with examples.
Co-authored-by: Codex CLI <codex@openai.com>
implement Integer#gcd and Integer#lcm methods in mruby-numeric-ext with full
support for both regular integers and bigints.
key changes:
- add mrb_int_gcd euclidean algorithm for regular integer gcd calculation
- implement int_gcd and int_lcm methods with proper type checking and bigint fallback
- add mrb_bint_gcd, mrb_bint_lcm, mrb_bint_abs functions to bigint api
- register gcd and lcm methods with integer class
- add comprehensive test coverage for both regular and bigint cases
Co-authored-by: Claude <noreply@anthropic.com>
Because they're defined in both `mruby-string-ext` and `mruby-numeric-ext`
(they seem more natural to define in N, but `mruby-string-ext` depends on
`Integral#chr`).
Solves #2355.
In test drivers:
* Uses `mrb_t_pass_result` to check and pass test result to main `mrb_state`.
* Adds `mrb_init_test_driver` to init test `mrb_state`.