fixed: did not compare properly with 0; reduced size

This commit is contained in:
ceriel 1989-12-13 16:35:19 +00:00
parent e891b36895
commit a0187208a5

View file

@ -13,19 +13,10 @@ flt_cmp(e1, e2)
{
int sign;
int tmp;
flt_arith x;
if (e1->m1 == 0 && e1->m2 == 0 &&
e2->m1 == 0 && e2->m2 == 0) {
return 0;
}
sign = e1->flt_sign ? -1 : 1;
if (e1->flt_sign > e2->flt_sign) return -1;
if (e1->flt_sign < e2->flt_sign) return 1;
if (e1->flt_exp < e2->flt_exp) return -sign;
if (e1->flt_exp > e2->flt_exp) return sign;
if ((tmp = ucmp(e1->m1, e2->m1)) < 0) return -sign;
if (tmp > 0) return sign;
if ((tmp = ucmp(e1->m2, e2->m2)) < 0) return -sign;
if (tmp > 0) return sign;
return 0;
flt_sub(e1, e2, &x);
if (x.m1 == 0 && x.m2 == 0) return 0;
if (x.flt_sign) return -1;
return 1;
}