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 /cmp_ui.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 'cmp_ui.c')
-rw-r--r-- | cmp_ui.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -44,6 +44,7 @@ mpfr_cmp_ui_2exp (b, i, f) if (MPFR_SIGN(b) < 0) return -1; /* now b>=0 */ + else if (MPFR_IS_INF(b)) return 1; else if (!MPFR_NOTZERO(b)) return((i) ? -1 : 0); /* now b>0 */ else if (i==0) return 1; @@ -88,7 +89,8 @@ mpfr_cmp_si_2exp(b, i, f) int e, k, bn, si; mp_limb_t c, *bp; si = (i<0) ? -1 : 1; /* sign of i */ - if (MPFR_SIGN(b) * i < 0) return MPFR_SIGN(b); /* both signs differ */ + if (MPFR_SIGN(b) * i < 0 || MPFR_IS_INF(b)) return MPFR_SIGN(b); + /* both signs differ */ else if (!MPFR_NOTZERO(b) || (i==0)) { /* one is zero */ if (i==0) return ((MPFR_NOTZERO(b)) ? MPFR_SIGN(b) : 0); else return si; /* b is zero */ |