From: ceriel Date: Fri, 5 Aug 1988 11:40:29 +0000 (+0000) Subject: also detect 0/0 X-Git-Tag: release-5-5~2948 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=05bac6c61940c7600f1965066a60d01e2f071914;p=ack.git also detect 0/0 --- diff --git a/mach/proto/fp/div_ext.c b/mach/proto/fp/div_ext.c index 883bd5497..447fdd164 100644 --- a/mach/proto/fp/div_ext.c +++ b/mach/proto/fp/div_ext.c @@ -31,6 +31,15 @@ EXTEND *e1,*e2; unsigned long result[2]; register unsigned long *lp; + if ((e2->m1 | e2->m2) == 0) { + /* + * Exception 8.2 - Divide by zero + */ + trap(EFDIVZ); + e1->m1 = e1->m2 = 0L; + e1->exp = EXT_MAX; + return; + } if ((e1->m1 | e1->m2) == 0) { /* 0 / anything == 0 */ e1->exp = 0; /* make sure */ return; @@ -57,15 +66,6 @@ EXTEND *e1,*e2; e1->m1 = e1->m2 = 0L; return; } - if ((e2->m1 | e2->m2) == 0) { - /* - * Exception 8.2 - Divide by zero - */ - trap(EFDIVZ); - e1->m1 = e1->m2 = 0L; - e1->exp = EXT_MAX; - return; - } if (e1->exp >= EXT_MAX) { /* * Exception 8.3 - Overflow