0/0 should not be infinity; fix #3752

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-07-25 15:11:31 +09:00
parent 7b8d784040
commit 9fa3d77114
+1 -1
View File
@@ -2372,7 +2372,7 @@ RETRY_TRY_BLOCK:
mrb_int x = mrb_fixnum(regs[a]);
mrb_int y = mrb_fixnum(regs[a+1]);
double f;
if (y == 0) {
if (y == 0 && x != 0) {
f = INFINITY;
}
else {