diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-09-28 08:13:29 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-09-28 08:13:29 +0000 |
commit | f7b738cb900737646435336e5932c089a4e3c32f (patch) | |
tree | 4ab47d8c518aa6e86216b3451c7f415ed217658a /Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h | |
parent | 460968dd6d10a96729c24a3f37e1f54928c39603 (diff) |
mpfr 3.1.5
git-svn-id: svn://tug.org/texlive/trunk@42168 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h')
-rw-r--r-- | Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h index cce39c3824f..0066f90d360 100644 --- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h +++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h @@ -251,19 +251,6 @@ typedef struct __gmpfr_cache_s *mpfr_cache_ptr; # define MPFR_WIN_THREAD_SAFE_DLL 1 #endif -/* Detect some possible inconsistencies under Unix. */ -#if defined(__unix__) -# if defined(_WIN32) -# error "Both __unix__ and _WIN32 are defined" -# endif -# if __GMP_LIBGMP_DLL -# error "__unix__ is defined and __GMP_LIBGMP_DLL is true" -# endif -# if defined(MPFR_WIN_THREAD_SAFE_DLL) -# error "Both __unix__ and MPFR_WIN_THREAD_SAFE_DLL are defined" -# endif -#endif - #if defined(__MPFR_WITHIN_MPFR) || !defined(MPFR_WIN_THREAD_SAFE_DLL) extern MPFR_THREAD_ATTR unsigned int __gmpfr_flags; extern MPFR_THREAD_ATTR mpfr_exp_t __gmpfr_emin; @@ -861,8 +848,8 @@ typedef intmax_t mpfr_eexp_t; (MPFR_ASSERTD((s) == MPFR_SIGN_POS || (s) == MPFR_SIGN_NEG)) #define MPFR_SET_SIGN(x, s) \ (MPFR_ASSERT_SIGN(s), MPFR_SIGN(x) = s) -#define MPFR_IS_POS_SIGN(s1) (s1 > 0) -#define MPFR_IS_NEG_SIGN(s1) (s1 < 0) +#define MPFR_IS_POS_SIGN(s1) ((s1) > 0) +#define MPFR_IS_NEG_SIGN(s1) ((s1) < 0) #define MPFR_MULT_SIGN(s1, s2) ((s1) * (s2)) /* Transform a sign to 1 or -1 */ #define MPFR_FROM_SIGN_TO_INT(s) (s) @@ -914,33 +901,37 @@ typedef intmax_t mpfr_eexp_t; /* We want to test if rnd = Zero, or Away. 'test' is 1 if negative, and 0 if positive. */ #define MPFR_IS_LIKE_RNDZ(rnd, test) \ - ((rnd==MPFR_RNDZ) || MPFR_IS_RNDUTEST_OR_RNDDNOTTEST (rnd, test)) + ((rnd) == MPFR_RNDZ || MPFR_IS_RNDUTEST_OR_RNDDNOTTEST (rnd, test)) -#define MPFR_IS_LIKE_RNDU(rnd, sign) \ - ((rnd==MPFR_RNDU) || (rnd==MPFR_RNDZ && sign<0) || (rnd==MPFR_RNDA && sign>0)) +#define MPFR_IS_LIKE_RNDU(rnd, sign) \ + (((rnd) == MPFR_RNDU) || \ + ((rnd) == MPFR_RNDZ && MPFR_IS_NEG_SIGN (sign)) || \ + ((rnd) == MPFR_RNDA && MPFR_IS_POS_SIGN (sign))) -#define MPFR_IS_LIKE_RNDD(rnd, sign) \ - ((rnd==MPFR_RNDD) || (rnd==MPFR_RNDZ && sign>0) || (rnd==MPFR_RNDA && sign<0)) +#define MPFR_IS_LIKE_RNDD(rnd, sign) \ + (((rnd) == MPFR_RNDD) || \ + ((rnd) == MPFR_RNDZ && MPFR_IS_POS_SIGN (sign)) || \ + ((rnd) == MPFR_RNDA && MPFR_IS_NEG_SIGN (sign))) /* Invert a rounding mode, RNDN, RNDZ and RNDA are unchanged */ -#define MPFR_INVERT_RND(rnd) ((rnd == MPFR_RNDU) ? MPFR_RNDD : \ - ((rnd == MPFR_RNDD) ? MPFR_RNDU : rnd)) +#define MPFR_INVERT_RND(rnd) ((rnd) == MPFR_RNDU ? MPFR_RNDD : \ + (rnd) == MPFR_RNDD ? MPFR_RNDU : (rnd)) /* Transform RNDU and RNDD to RNDZ according to test */ -#define MPFR_UPDATE_RND_MODE(rnd, test) \ - do { \ - if (MPFR_UNLIKELY(MPFR_IS_RNDUTEST_OR_RNDDNOTTEST(rnd, test))) \ +#define MPFR_UPDATE_RND_MODE(rnd, test) \ + do { \ + if (MPFR_UNLIKELY(MPFR_IS_RNDUTEST_OR_RNDDNOTTEST(rnd, test))) \ rnd = MPFR_RNDZ; \ } while (0) /* Transform RNDU and RNDD to RNDZ or RNDA according to sign, leave the other modes unchanged */ -#define MPFR_UPDATE2_RND_MODE(rnd, sign) \ - do { \ - if (rnd == MPFR_RNDU) \ - rnd = (sign > 0) ? MPFR_RNDA : MPFR_RNDZ; \ - else if (rnd == MPFR_RNDD) \ - rnd = (sign < 0) ? MPFR_RNDA : MPFR_RNDZ; \ +#define MPFR_UPDATE2_RND_MODE(rnd, sign) \ + do { \ + if (rnd == MPFR_RNDU) \ + rnd = MPFR_IS_POS_SIGN (sign) ? MPFR_RNDA : MPFR_RNDZ; \ + else if (rnd == MPFR_RNDD) \ + rnd = MPFR_IS_NEG_SIGN (sign) ? MPFR_RNDA : MPFR_RNDZ; \ } while (0) @@ -1897,6 +1888,7 @@ __MPFR_DECLSPEC mpfr_exp_t mpfr_ceil_mul _MPFR_PROTO ((mpfr_exp_t, int, int)); __MPFR_DECLSPEC int mpfr_exp_2 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_exp_3 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_powerof2_raw _MPFR_PROTO ((mpfr_srcptr)); +__MPFR_DECLSPEC int mpfr_powerof2_raw2 (const mp_limb_t *, mp_size_t); __MPFR_DECLSPEC int mpfr_pow_general _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t, int, mpfr_save_expo_t *)); |