redefine POST/NEG FIXABLE using INT_MIN/MAX

This commit is contained in:
Yukihiro Matsumoto
2012-05-17 09:32:23 +09:00
parent db20b4e063
commit 470da1eda0
2 changed files with 3 additions and 6 deletions
+1 -2
View File
@@ -565,8 +565,7 @@ mrb_convert_to_integer(mrb_state *mrb, mrb_value val, int base)
switch (mrb_type(val)) {
case MRB_TT_FLOAT:
if (base != 0) goto arg_error;
if (mrb_float(val) <= (double)FIXNUM_MAX
&& mrb_float(val) >= (double)FIXNUM_MIN) {
if (FIXABLE(mrb_float(val))) {
break;
}
return mrb_flt2big(mrb, mrb_float(val));