summaryrefslogtreecommitdiff
path: root/mul.c
diff options
context:
space:
mode:
authorhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-13 14:50:13 +0000
committerhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-13 14:50:13 +0000
commit3035f62d87667e08ac5370bca1e47fe8f683c2e8 (patch)
treec92b2c9b03671e77b17f5ca89f731e53cdfaa1ce /mul.c
parentee574c97721b76618933ca6d5738f948e7abe1ec (diff)
downloadmpfr-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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mul.c b/mul.c
index 30bfb2f58..f2d32fb86 100644
--- a/mul.c
+++ b/mul.c
@@ -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;