summaryrefslogtreecommitdiff
path: root/mul.c
diff options
context:
space:
mode:
authorhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-11-21 15:21:33 +0000
committerhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-11-21 15:21:33 +0000
commitebb0a24940eb551ce03eb361910c423fee7d6499 (patch)
tree46fccc5920d05d93d00ecd30aff4a012adba3d13 /mul.c
parent1cc85c4f5a5658c530891f7348c153155b6dddbb (diff)
downloadmpfr-ebb0a24940eb551ce03eb361910c423fee7d6499.tar.gz
Infinis, premiere tentative.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@793 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'mul.c')
-rw-r--r--mul.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mul.c b/mul.c
index 6c899f645..dd693b3bb 100644
--- a/mul.c
+++ b/mul.c
@@ -47,6 +47,22 @@ mpfr_mul(a, b, c, rnd_mode)
/* deal with NaN and zero */
if (MPFR_IS_NAN(b) || MPFR_IS_NAN(c)) { MPFR_SET_NAN(a); return; }
+ if (MPFR_IS_INF(b))
+ {
+ if (!MPFR_NOTZERO(c)) { MPFR_SET_NAN(a); return; }
+ else
+ {
+ if (MPFR_SIGN(a) != MPFR_SIGN(b) * MPFR_SIGN(c)) MPFR_CHANGE_SIGN(a);
+ }
+ }
+ else if (MPFR_IS_INF(c))
+ {
+ if (!MPFR_NOTZERO(b)) { MPFR_SET_NAN(a); return; }
+ else
+ {
+ if (MPFR_SIGN(a) != MPFR_SIGN(b) * MPFR_SIGN(c)) MPFR_CHANGE_SIGN(a);
+ }
+ }
if (!MPFR_NOTZERO(b) || !MPFR_NOTZERO(c)) { MPFR_SET_ZERO(a); return; }
sign_product = MPFR_SIGN(b) * MPFR_SIGN(c);