From 05bac6c61940c7600f1965066a60d01e2f071914 Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 5 Aug 1988 11:40:29 +0000 Subject: [PATCH] also detect 0/0 --- mach/proto/fp/div_ext.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 -- 2.34.1