diff options
author | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-11-21 15:21:33 +0000 |
---|---|---|
committer | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-11-21 15:21:33 +0000 |
commit | ebb0a24940eb551ce03eb361910c423fee7d6499 (patch) | |
tree | 46fccc5920d05d93d00ecd30aff4a012adba3d13 /mul.c | |
parent | 1cc85c4f5a5658c530891f7348c153155b6dddbb (diff) | |
download | mpfr-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.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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); |