diff options
author | Paul Zimmermann <Paul.Zimmermann@inria.fr> | 2017-10-04 22:09:40 +0200 |
---|---|---|
committer | Paul Zimmermann <Paul.Zimmermann@inria.fr> | 2017-10-04 22:09:40 +0200 |
commit | 5eaa17651b759c7856a118835802fecbebcf46ad (patch) | |
tree | 5887411be4b82edff2e9b1de532445cf390bd5c4 | |
parent | a3f939169482a4c502d276e1b3c814b0ea63f423 (diff) | |
download | mpc-git-5eaa17651b759c7856a118835802fecbebcf46ad.tar.gz |
replace obsolete mpfr_add_one_ulp/mpfr_sub_one_ulp functions
-rw-r--r-- | src/mpc-impl.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mpc-impl.h b/src/mpc-impl.h index 4026765..5420691 100644 --- a/src/mpc-impl.h +++ b/src/mpc-impl.h @@ -60,8 +60,10 @@ along with this program. If not, see http://www.gnu.org/licenses/ . mpfr_setsign (x, y, 0, rnd) : \ mpfr_copysign (x, y, z, rnd)) /* work around spurious signs in nan */ -#define MPFR_ADD_ONE_ULP(x) mpfr_add_one_ulp (x, MPFR_RNDN) -#define MPFR_SUB_ONE_ULP(x) mpfr_sub_one_ulp (x, MPFR_RNDN) +#define MPFR_ADD_ONE_ULP(x) \ + (mpfr_sgn (x) > 0 ? mpfr_nextabove (x) : mpfr_nextbelow (x)) +#define MPFR_SUB_ONE_ULP(x) \ + (mpfr_sgn (x) > 0 ? mpfr_nextbelow (x) : mpfr_nextabove (x)) /* drop unused rounding mode from macros */ #define MPFR_SWAP(a,b) do { mpfr_srcptr tmp; tmp = a; a = b; b = tmp; } while (0) |