diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-07 19:27:57 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-07 19:27:57 +0200 |
commit | d7a4f8d3b7d0ebab6a1b6bef8f342e100ea32f1d (patch) | |
tree | 57665831d8e623355a11e69182e23fb9ef44ba7a /eval.c | |
parent | c161e760113f5712689e8d15fd8141b77d82d7f5 (diff) |
eval: ensure that dividing Infinity by Infinity yields NaN
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |