summaryrefslogtreecommitdiff
path: root/mul.c
diff options
context:
space:
mode:
authorhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-15 14:42:57 +0000
committerhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-15 14:42:57 +0000
commit7fa469c7d1f80e8dfb712054c399215fa87ed823 (patch)
treea0b22195c66ed18f013933859a756500d31a633d /mul.c
parentb645ffe10f08d77aa1f43d126736f454cf8779c9 (diff)
downloadmpfr-7fa469c7d1f80e8dfb712054c399215fa87ed823.tar.gz
A few patches.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@870 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'mul.c')
-rw-r--r--mul.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/mul.c b/mul.c
index bf89576c5..4de579cae 100644
--- a/mul.c
+++ b/mul.c
@@ -46,26 +46,30 @@ mpfr_mul(a, b, c, rnd_mode)
TMP_DECL(marker);
/* deal with NaN and zero */
- if (MPFR_IS_NAN(b) || MPFR_IS_NAN(c)) { MPFR_SET_NAN(a); return; }
+ if (MPFR_IS_NAN(b) || MPFR_IS_NAN(c))
+ { MPFR_CLEAR_FLAGS(a); MPFR_SET_NAN(a); return; }
if (MPFR_IS_INF(b))
{
- if (!MPFR_NOTZERO(c)) { MPFR_SET_NAN(a); return; }
+ if (!MPFR_NOTZERO(c)) { MPFR_CLEAR_FLAGS(a); MPFR_SET_NAN(a); return; }
else
{
if (MPFR_SIGN(a) != MPFR_SIGN(b) * MPFR_SIGN(c)) MPFR_CHANGE_SIGN(a);
+ MPFR_CLEAR_FLAGS(a);
MPFR_SET_INF(a); return;
}
}
else if (MPFR_IS_INF(c))
{
- if (!MPFR_NOTZERO(b)) { MPFR_SET_NAN(a); return; }
+ if (!MPFR_NOTZERO(b)) { MPFR_CLEAR_FLAGS(a); MPFR_SET_NAN(a); return; }
else
{
if (MPFR_SIGN(a) != MPFR_SIGN(b) * MPFR_SIGN(c)) MPFR_CHANGE_SIGN(a);
- MPFR_SET_INF(a); return;
+ MPFR_CLEAR_FLAGS(a); MPFR_SET_INF(a); return;
}
}
- if (!MPFR_NOTZERO(b) || !MPFR_NOTZERO(c)) { MPFR_SET_ZERO(a); return; }
+
+ if (!MPFR_NOTZERO(b) || !MPFR_NOTZERO(c))
+ { MPFR_CLEAR_FLAGS(a); MPFR_SET_ZERO(a); return; }
sign_product = MPFR_SIGN(b) * MPFR_SIGN(c);