diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-07-26 15:52:58 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-07-26 15:52:58 +0000 |
commit | 49c11f49544fd4ee9b0f88f4bdc742a86583852e (patch) | |
tree | 1bfda22c1dad2721f7a684c26d9bbfe33ebc9cbd /next.c | |
parent | 705a965275388c9cbd0491867e3c1138325c3af0 (diff) | |
download | mpfr-49c11f49544fd4ee9b0f88f4bdc742a86583852e.tar.gz |
Prototype of mpfr_setmax and mpfr_setmin changed (exponent given).
In mpfr_exp for x ~= 0, add_one_ulp and sub_one_ulp are no longer
used (sub_one_ulp was incorrect). These cases should now be faster.
Small fix in mpfr_nextabove, mpfr_nextbelow and mpfr_nexttoward.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2002 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'next.c')
-rw-r--r-- | next.c | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -32,14 +32,14 @@ mpfr_nexttozero (mpfr_ptr x) if (MPFR_IS_INF(x)) { MPFR_CLEAR_FLAGS(x); - mpfr_setmax (x); + mpfr_setmax (x, __mpfr_emax); return; } if (MPFR_IS_ZERO(x)) { MPFR_CHANGE_SIGN(x); - mpfr_setmin (x); + mpfr_setmin (x, __mpfr_emin); } else { @@ -75,7 +75,7 @@ mpfr_nexttoinf (mpfr_ptr x) return; if (MPFR_IS_ZERO(x)) - mpfr_setmin (x); + mpfr_setmin (x, __mpfr_emin); else { mp_size_t xn; @@ -103,7 +103,10 @@ void mpfr_nextabove (mpfr_ptr x) { if (MPFR_IS_NAN(x)) - MPFR_RET_NAN; + { + __mpfr_flags |= MPFR_FLAGS_NAN; + return; + } if (MPFR_SIGN(x) < 0) mpfr_nexttozero (x); @@ -115,7 +118,10 @@ void mpfr_nextbelow (mpfr_ptr x) { if (MPFR_IS_NAN(x)) - MPFR_RET_NAN; + { + __mpfr_flags |= MPFR_FLAGS_NAN; + return; + } if (MPFR_SIGN(x) < 0) mpfr_nexttoinf (x); @@ -129,7 +135,10 @@ mpfr_nexttoward (mpfr_ptr x, mpfr_srcptr y) int s; if (MPFR_IS_NAN(x) || MPFR_IS_NAN(y)) - MPFR_RET_NAN; + { + __mpfr_flags |= MPFR_FLAGS_NAN; + return; + } s = mpfr_cmp (x, y); if (s == 0) |