summaryrefslogtreecommitdiff
path: root/exp3.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 /exp3.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 'exp3.c')
-rw-r--r--exp3.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/exp3.c b/exp3.c
index 741a6a268..6de20291d 100644
--- a/exp3.c
+++ b/exp3.c
@@ -174,6 +174,14 @@ mp_rnd_t rnd_mode;
int logn;
/* commencons par 0 */
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;