diff options
author | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-12-13 14:50:13 +0000 |
---|---|---|
committer | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-12-13 14:50:13 +0000 |
commit | 3035f62d87667e08ac5370bca1e47fe8f683c2e8 (patch) | |
tree | c92b2c9b03671e77b17f5ca89f731e53cdfaa1ce /mul.c | |
parent | ee574c97721b76618933ca6d5738f948e7abe1ec (diff) | |
download | mpfr-3035f62d87667e08ac5370bca1e47fe8f683c2e8.tar.gz |
Take into account Inf, Nans ; clear the flags of the return variable
in most function calls.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@851 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'mul.c')
-rw-r--r-- | mul.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -53,6 +53,7 @@ mpfr_mul(a, b, c, rnd_mode) else { if (MPFR_SIGN(a) != MPFR_SIGN(b) * MPFR_SIGN(c)) MPFR_CHANGE_SIGN(a); + MPFR_SET_INF(a); return; } } else if (MPFR_IS_INF(c)) @@ -61,11 +62,14 @@ mpfr_mul(a, b, c, rnd_mode) else { if (MPFR_SIGN(a) != MPFR_SIGN(b) * MPFR_SIGN(c)) MPFR_CHANGE_SIGN(a); + MPFR_SET_INF(a); return; } } if (!MPFR_NOTZERO(b) || !MPFR_NOTZERO(c)) { MPFR_SET_ZERO(a); return; } sign_product = MPFR_SIGN(b) * MPFR_SIGN(c); + + MPFR_CLEAR_FLAGS(a); bn = (MPFR_PREC(b)-1)/BITS_PER_MP_LIMB+1; /* number of significant limbs of b */ cn = (MPFR_PREC(c)-1)/BITS_PER_MP_LIMB+1; /* number of significant limbs of c */ tn = (MPFR_PREC(c)+MPFR_PREC(b)-1)/BITS_PER_MP_LIMB+1; |