fp& fp::operator /= (const fp& f)
{ // divide this fp object by f
fp f1 = ARG(*this);
fp f2 = ARG(f);
if (IS_NAN(f1))
*this = f1;
else if (IS_NAN(f2))
*this = f2;
else if (IS_INF(f1) && IS_INF(f2) ||
IS_ZERO(f1) && IS_ZERO(f2))
*this = exception(inv, f1);
else if (IS_ZERO(f1))
*this = f1.is_neg == f2.is_neg ? zero : nzero;
else if (IS_ZERO(f2))
*this = exception(dbz, f2.is_neg ? -f1 : f1);
else if (IS_INF(f1))
*this = f1.is_neg == f2.is_neg ? pinf : ninf;
else if (IS_INF(f2))
*this = f1.is_neg == f2.is_neg ? zero : nzero;
else
normalize(f1.exp - f2.exp + BIAS,
((f1.lf() << P) / f2.lf()) << P);
return *this;
}