Skip to content

Commit

Permalink
Let Fixnum#{ceil,floor,round,truncate} to return itself; #3652
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed May 26, 2017
1 parent 06c4933 commit c80696f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,10 @@ mrb_init_numeric(mrb_state *mrb)
mrb_define_method(mrb, fixnum, "to_s", fix_to_s, MRB_ARGS_NONE()); /* 15.2.8.3.25 */
mrb_define_method(mrb, fixnum, "inspect", fix_to_s, MRB_ARGS_NONE());
mrb_define_method(mrb, fixnum, "divmod", fix_divmod, MRB_ARGS_REQ(1)); /* 15.2.8.3.30 (x) */
mrb_define_method(mrb, fixnum, "ceil", int_to_i, MRB_ARGS_REQ(1)); /* 15.2.8.3.8 (x) */
mrb_define_method(mrb, fixnum, "floor", int_to_i, MRB_ARGS_REQ(1)); /* 15.2.8.3.10 (x) */
mrb_define_method(mrb, fixnum, "round", int_to_i, MRB_ARGS_REQ(1)); /* 15.2.8.3.12 (x) */
mrb_define_method(mrb, fixnum, "truncate", int_to_i, MRB_ARGS_REQ(1)); /* 15.2.8.3.15 (x) */

/* Float Class */
mrb->float_class = fl = mrb_define_class(mrb, "Float", numeric); /* 15.2.9 */
Expand Down

0 comments on commit c80696f

Please sign in to comment.