From 268f6dcab38cfc397891b4a08e04e80389d7354c Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 3 Oct 2022 14:23:09 +0900 Subject: [PATCH] numeric.c (mrb_float_to_integer): isinf/isnan takes any float values. So don't need to cast to `float`, just use `mrb_float`. --- src/numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/numeric.c b/src/numeric.c index 30aa68d7c..5c76cf51e 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -1766,7 +1766,7 @@ mrb_float_to_integer(mrb_state *mrb, mrb_value x) if (!mrb_float_p(x)) { mrb_raise(mrb, E_TYPE_ERROR, "non float value"); } - float f = mrb_float(x); + mrb_float f = mrb_float(x); if (isinf(f) || isnan(f)) { mrb_raisef(mrb, E_RANGE_ERROR, "float %f out of range", f); }