From 4b42dcf97f15ea2cc02917ae226d3c7353a568c0 Mon Sep 17 00:00:00 2001 From: ceriel Date: Tue, 19 Dec 1989 09:27:16 +0000 Subject: [PATCH] fix: flt_status was not always set properly --- modules/src/flt_arith/flt_str2fl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/src/flt_arith/flt_str2fl.c b/modules/src/flt_arith/flt_str2fl.c index eeafce8e1..61c205e61 100644 --- a/modules/src/flt_arith/flt_str2fl.c +++ b/modules/src/flt_arith/flt_str2fl.c @@ -200,20 +200,22 @@ add_exponent(e, exp) int neg = exp < 0; int divsz, modsz; flt_arith x; - int status; + register int status = 0; if (neg) exp = -exp; divsz = exp / SMALLSZ; modsz = exp % SMALLSZ; + if (!status) status = flt_status; flt_mul(e, (neg ? r_10pow : s10pow) + modsz, &x); - if (flt_status) status = flt_status; + if (!status) status = flt_status; while (divsz >= BIGSZ) { flt_mul(&x, neg ? &r_big_10pow[BIGSZ-1] : &big_10pow[BIGSZ-1],&x); - if (flt_status) status = flt_status; + if (!status) status = flt_status; divsz -= BIGSZ-1; } flt_mul(&x, (neg ? r_big_10pow : big_10pow) + divsz, e); - if (flt_status) status = flt_status; + if (!status) status = flt_status; + flt_status = status; } flt_str2flt(s, e) -- 2.34.1