mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Integrate mrblib/float.rb into src/numeric.c
- Avoid hack for `MRB_WITHOUT_FLOAT` in build scripts - Avoid runtime dispatch for `MRB_WITHOUT_FLOAT`
This commit is contained in:
+5
-2
@@ -1487,11 +1487,13 @@ flo_plus(mrb_state *mrb, mrb_value x)
|
||||
void
|
||||
mrb_init_numeric(mrb_state *mrb)
|
||||
{
|
||||
struct RClass *numeric, *integer, *fixnum;
|
||||
struct RClass *numeric, *integer, *fixnum, *integral;
|
||||
#ifndef MRB_WITHOUT_FLOAT
|
||||
struct RClass *fl;
|
||||
#endif
|
||||
|
||||
integral = mrb_define_module(mrb, "Integral");
|
||||
|
||||
/* Numeric Class */
|
||||
numeric = mrb_define_class(mrb, "Numeric", mrb->object_class); /* 15.2.7 */
|
||||
|
||||
@@ -1578,6 +1580,7 @@ mrb_init_numeric(mrb_state *mrb)
|
||||
#ifdef NAN
|
||||
mrb_define_const(mrb, fl, "NAN", mrb_float_value(mrb, NAN));
|
||||
#endif
|
||||
|
||||
mrb_include_module(mrb, fl, integral);
|
||||
#endif
|
||||
mrb_define_module(mrb, "Integral");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user