Skip to content

Commit

Permalink
Add ISO Number to Numeric, Integer and Float
Browse files Browse the repository at this point in the history
  • Loading branch information
bovi committed Jun 16, 2013
1 parent 2c1299d commit 007faa1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/numeric.c
Expand Up @@ -1356,7 +1356,7 @@ mrb_init_numeric(mrb_state *mrb)
struct RClass *numeric, *integer, *fixnum, *fl;

/* Numeric Class */
numeric = mrb_define_class(mrb, "Numeric", mrb->object_class);
numeric = mrb_define_class(mrb, "Numeric", mrb->object_class); /* 15.2.7 */
mrb_include_module(mrb, numeric, mrb_class_get(mrb, "Comparable"));

mrb_define_method(mrb, numeric, "+@", num_uplus, MRB_ARGS_REQ(1)); /* 15.2.7.4.1 */
Expand All @@ -1368,7 +1368,7 @@ mrb_init_numeric(mrb_state *mrb)
mrb_define_method(mrb, numeric, "<=>", num_cmp, MRB_ARGS_REQ(1)); /* 15.2.9.3.6 */

/* Integer Class */
integer = mrb_define_class(mrb, "Integer", numeric);
integer = mrb_define_class(mrb, "Integer", numeric); /* 15.2.8 */
mrb_undef_class_method(mrb, integer, "new");
mrb_define_method(mrb, integer, "to_i", int_to_i, MRB_ARGS_NONE()); /* 15.2.8.3.24 */
mrb_define_method(mrb, integer, "to_int", int_to_i, MRB_ARGS_NONE());
Expand Down Expand Up @@ -1396,7 +1396,7 @@ mrb_init_numeric(mrb_state *mrb)
mrb_define_method(mrb, fixnum, "divmod", fix_divmod, MRB_ARGS_REQ(1)); /* 15.2.8.3.30 (x) */

/* Float Class */
fl = mrb->float_class = mrb_define_class(mrb, "Float", numeric);
fl = mrb->float_class = mrb_define_class(mrb, "Float", numeric); /* 15.2.9 */
mrb_undef_class_method(mrb, fl, "new");
mrb_define_method(mrb, fl, "+", flo_plus, MRB_ARGS_REQ(1)); /* 15.2.9.3.1 */
mrb_define_method(mrb, fl, "-", flo_minus, MRB_ARGS_REQ(1)); /* 15.2.9.3.2 */
Expand Down

0 comments on commit 007faa1

Please sign in to comment.