From: ceriel Date: Mon, 13 Nov 1989 12:54:33 +0000 (+0000) Subject: fixes: ucmp did not quite work right, flt_div had an obscure bug X-Git-Tag: release-5-5~2082 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=c30769327b8e615f1381c0fbb1e5dcd54085e0a5;p=ack.git fixes: ucmp did not quite work right, flt_div had an obscure bug --- diff --git a/modules/src/flt_arith/flt_div.c b/modules/src/flt_arith/flt_div.c index 4e298706b..9ec1f483d 100644 --- a/modules/src/flt_arith/flt_div.c +++ b/modules/src/flt_arith/flt_div.c @@ -69,7 +69,7 @@ flt_div(e1,e2,e3) long rem; q_est = (0x7FFFFFFF/v1)+((temp&0x7FFFFFFF)/v1); rem = (0x7FFFFFFF%v1)+((temp&0x7FFFFFFF)%v1)+1; - while (rem > v1) { + while (rem >= v1) { q_est++; rem -= v1; } diff --git a/modules/src/flt_arith/ucmp.c b/modules/src/flt_arith/ucmp.c index 309ea71f4..420183eb3 100644 --- a/modules/src/flt_arith/ucmp.c +++ b/modules/src/flt_arith/ucmp.c @@ -16,6 +16,6 @@ ucmp(l1,l2) if (l1 > l2 || l1 < 0) return 1; return -1; } - if (l1 > 0 || l1 < l2) return -1; + if (l1 >= 0 || l1 < l2) return -1; return 1; }