summaryrefslogtreecommitdiff
path: root/exp2.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 /exp2.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 'exp2.c')
-rw-r--r--exp2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/exp2.c b/exp2.c
index 9e8e090be..74ad9ac86 100644
--- a/exp2.c
+++ b/exp2.c
@@ -106,6 +106,14 @@ mpfr_exp2(y, x, rnd_mode)
TMP_DECL(marker);
if (MPFR_IS_NAN(x)) { MPFR_SET_NAN(y); return 1; }
+ if (MPFR_IS_INF(x))
+ {
+ if (MPFR_SIGN(x) > 0)
+ { MPFR_SET_INF(y); if (MPFR_SIGN(y) == -1) { MPFR_CHANGE_SIGN(y); } }
+ else
+ { MPFR_SET_ZERO(y); if (MPFR_SIGN(y) == -1) { MPFR_CHANGE_SIGN(y); } }
+ /* TODO: conflits entre infinis et zeros ? */
+ }
if (!MPFR_NOTZERO(x)) { mpfr_set_ui(y, 1, GMP_RNDN); return 0; }
expx = MPFR_EXP(x);