diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-07 19:06:07 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-07 19:06:07 +0200 |
commit | c161e760113f5712689e8d15fd8141b77d82d7f5 (patch) | |
tree | c2d73608edbd50ea3107b3446ed7dcf913308b6f /eval.c | |
parent | 93f25fb15faf7dce6d59954665dcb6d594255b12 (diff) |
eval: ensure that x / NaN 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, 2 insertions, 0 deletions
@@ -1085,6 +1085,8 @@ ut_execute_arith(struct ut_state *state, uint32_t off) case T_DIV: if (d2 == 0.0) return ut_new_double(INFINITY); + else if (isnan(d2)) + return ut_new_double(NAN); else if (!isfinite(d2)) return ut_new_double(0.0); |