summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 6d6f8c3..4bcc2b2 100644
--- a/eval.c
+++ b/eval.c
@@ -1088,7 +1088,7 @@ ut_execute_arith(struct ut_state *state, uint32_t off)
else if (isnan(d2))
return ut_new_double(NAN);
else if (!isfinite(d2))
- return ut_new_double(0.0);
+ return ut_new_double(isfinite(d1) ? 0.0 : NAN);
return ut_new_double(d1 / d2);