diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2010-04-30 14:37:47 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2010-04-30 14:37:47 +0000 |
commit | acfc55ee40c11735c67f86554adae6f06fb27bf6 (patch) | |
tree | b3825ef6d5f8bb416694facf37f449375aacb391 | |
parent | 36b2d705037cc99806b571fc7222f445e7d10f81 (diff) | |
download | mpfr-acfc55ee40c11735c67f86554adae6f06fb27bf6.tar.gz |
Changed mp_prec_t into mpfr_prec_t.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6767 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | README.dev | 4 | ||||
-rw-r--r-- | acos.c | 2 | ||||
-rw-r--r-- | acosh.c | 6 | ||||
-rw-r--r-- | add1.c | 6 | ||||
-rw-r--r-- | add1sp.c | 2 | ||||
-rw-r--r-- | agm.c | 4 | ||||
-rw-r--r-- | asin.c | 2 | ||||
-rw-r--r-- | asinh.c | 2 | ||||
-rw-r--r-- | atan.c | 12 | ||||
-rw-r--r-- | atan2.c | 4 | ||||
-rw-r--r-- | atanh.c | 2 | ||||
-rw-r--r-- | cache.c | 4 | ||||
-rw-r--r-- | cbrt.c | 2 | ||||
-rw-r--r-- | check.c | 2 | ||||
-rw-r--r-- | cmp2.c | 4 | ||||
-rw-r--r-- | const_catalan.c | 2 | ||||
-rw-r--r-- | const_euler.c | 2 | ||||
-rw-r--r-- | const_log2.c | 2 | ||||
-rw-r--r-- | const_pi.c | 2 | ||||
-rw-r--r-- | cos.c | 4 | ||||
-rw-r--r-- | cosh.c | 4 | ||||
-rw-r--r-- | digamma.c | 6 | ||||
-rw-r--r-- | eint.c | 6 | ||||
-rw-r--r-- | erf.c | 4 | ||||
-rw-r--r-- | erfc.c | 4 | ||||
-rw-r--r-- | examples/rndo-add.c | 2 | ||||
-rw-r--r-- | exp.c | 4 | ||||
-rw-r--r-- | exp2.c | 4 | ||||
-rw-r--r-- | exp3.c | 16 | ||||
-rw-r--r-- | exp_2.c | 12 | ||||
-rw-r--r-- | expm1.c | 4 | ||||
-rw-r--r-- | factorial.c | 6 | ||||
-rw-r--r-- | fits_intmax.c | 2 | ||||
-rw-r--r-- | fits_s.h | 2 | ||||
-rw-r--r-- | fits_u.h | 2 | ||||
-rw-r--r-- | fits_uintmax.c | 2 | ||||
-rw-r--r-- | fma.c | 2 | ||||
-rw-r--r-- | fms.c | 2 | ||||
-rw-r--r-- | frac.c | 4 | ||||
-rw-r--r-- | gamma.c | 12 | ||||
-rw-r--r-- | gen_inverse.h | 4 | ||||
-rw-r--r-- | get_f.c | 6 | ||||
-rw-r--r-- | get_si.c | 2 | ||||
-rw-r--r-- | get_sj.c | 6 | ||||
-rw-r--r-- | get_ui.c | 2 | ||||
-rw-r--r-- | get_uj.c | 4 | ||||
-rw-r--r-- | gmp_op.c | 12 | ||||
-rw-r--r-- | hypot.c | 8 | ||||
-rw-r--r-- | init2.c | 2 | ||||
-rw-r--r-- | inits2.c | 8 | ||||
-rw-r--r-- | isinteger.c | 2 | ||||
-rw-r--r-- | jn.c | 2 | ||||
-rw-r--r-- | jyn_asympt.c | 2 | ||||
-rw-r--r-- | li2.c | 4 | ||||
-rw-r--r-- | lngamma.c | 10 | ||||
-rw-r--r-- | log.c | 4 | ||||
-rw-r--r-- | log10.c | 4 | ||||
-rw-r--r-- | log1p.c | 4 | ||||
-rw-r--r-- | log2.c | 4 | ||||
-rw-r--r-- | logging.c | 6 | ||||
-rw-r--r-- | mbench/mpfr-gfx.c | 18 | ||||
-rw-r--r-- | mbench/mpfr-v4.c | 8 | ||||
-rw-r--r-- | mbench/mpfr-v6.c | 4 | ||||
-rw-r--r-- | modf.c | 2 | ||||
-rw-r--r-- | mpfr-impl.h | 52 | ||||
-rw-r--r-- | mpfr.h | 12 | ||||
-rw-r--r-- | mpfr.texi | 38 | ||||
-rw-r--r-- | mul.c | 6 | ||||
-rw-r--r-- | mul_ui.c | 2 | ||||
-rw-r--r-- | pow.c | 10 | ||||
-rw-r--r-- | pow_si.c | 4 | ||||
-rw-r--r-- | pow_ui.c | 2 | ||||
-rw-r--r-- | pow_z.c | 4 | ||||
-rw-r--r-- | print_raw.c | 12 | ||||
-rw-r--r-- | rec_sqrt.c | 10 | ||||
-rw-r--r-- | root.c | 2 | ||||
-rw-r--r-- | round_p.c | 10 | ||||
-rw-r--r-- | round_prec.c | 18 | ||||
-rw-r--r-- | round_raw_generic.c | 4 | ||||
-rw-r--r-- | set_dfl_prec.c | 6 | ||||
-rw-r--r-- | set_prec.c | 2 | ||||
-rw-r--r-- | set_q.c | 2 | ||||
-rw-r--r-- | set_z_exp.c | 2 | ||||
-rw-r--r-- | setmax.c | 2 | ||||
-rw-r--r-- | sin.c | 2 | ||||
-rw-r--r-- | sin_cos.c | 26 | ||||
-rw-r--r-- | sinh.c | 2 | ||||
-rw-r--r-- | sinh_cosh.c | 2 | ||||
-rw-r--r-- | speed.c | 12 | ||||
-rw-r--r-- | sqr.c | 2 | ||||
-rw-r--r-- | stack_interface.c | 6 | ||||
-rw-r--r-- | strtofr.c | 2 | ||||
-rw-r--r-- | sub1.c | 4 | ||||
-rw-r--r-- | sub1sp.c | 6 | ||||
-rw-r--r-- | subnormal.c | 2 | ||||
-rw-r--r-- | sum.c | 4 | ||||
-rw-r--r-- | tan.c | 2 | ||||
-rw-r--r-- | tanh.c | 4 | ||||
-rw-r--r-- | tests/mpfr-test.h | 4 | ||||
-rw-r--r-- | tests/reuse.c | 16 | ||||
-rw-r--r-- | tests/tabs.c | 2 | ||||
-rw-r--r-- | tests/tadd.c | 10 | ||||
-rw-r--r-- | tests/tadd1sp.c | 2 | ||||
-rw-r--r-- | tests/taway.c | 12 | ||||
-rw-r--r-- | tests/tcan_round.c | 6 | ||||
-rw-r--r-- | tests/tcbrt.c | 2 | ||||
-rw-r--r-- | tests/tcmp.c | 2 | ||||
-rw-r--r-- | tests/tcmp2.c | 6 | ||||
-rw-r--r-- | tests/tcomparisons.c | 4 | ||||
-rw-r--r-- | tests/tconst_log2.c | 2 | ||||
-rw-r--r-- | tests/tconst_pi.c | 4 | ||||
-rw-r--r-- | tests/tdiv.c | 6 | ||||
-rw-r--r-- | tests/tdiv_ui.c | 2 | ||||
-rw-r--r-- | tests/teint.c | 2 | ||||
-rw-r--r-- | tests/tests.c | 8 | ||||
-rw-r--r-- | tests/texp.c | 8 | ||||
-rw-r--r-- | tests/tfactorial.c | 2 | ||||
-rw-r--r-- | tests/tfma.c | 4 | ||||
-rw-r--r-- | tests/tfms.c | 4 | ||||
-rw-r--r-- | tests/tfrac.c | 2 | ||||
-rw-r--r-- | tests/tgeneric.c | 4 | ||||
-rw-r--r-- | tests/tgeneric_ui.c | 4 | ||||
-rw-r--r-- | tests/tget_sj.c | 2 | ||||
-rw-r--r-- | tests/tget_str.c | 6 | ||||
-rw-r--r-- | tests/tgmpop.c | 24 | ||||
-rw-r--r-- | tests/tmodf.c | 2 | ||||
-rw-r--r-- | tests/tmul.c | 2 | ||||
-rw-r--r-- | tests/tmul_ui.c | 6 | ||||
-rw-r--r-- | tests/tnext.c | 4 | ||||
-rw-r--r-- | tests/tpow.c | 6 | ||||
-rw-r--r-- | tests/tpow3.c | 4 | ||||
-rw-r--r-- | tests/tpow_z.c | 4 | ||||
-rw-r--r-- | tests/trandom.c | 4 | ||||
-rw-r--r-- | tests/trint.c | 4 | ||||
-rw-r--r-- | tests/troot.c | 2 | ||||
-rw-r--r-- | tests/tset_sj.c | 4 | ||||
-rw-r--r-- | tests/tsin.c | 2 | ||||
-rw-r--r-- | tests/tsin_cos.c | 10 | ||||
-rw-r--r-- | tests/tsqrt.c | 12 | ||||
-rw-r--r-- | tests/tstckintc.c | 4 | ||||
-rw-r--r-- | tests/tstrtofr.c | 8 | ||||
-rw-r--r-- | tests/tsub.c | 6 | ||||
-rw-r--r-- | tests/tsub_ui.c | 4 | ||||
-rw-r--r-- | tests/tsum.c | 16 | ||||
-rw-r--r-- | tests/tui_div.c | 2 | ||||
-rw-r--r-- | tests/tui_pow.c | 8 | ||||
-rw-r--r-- | tests/tui_sub.c | 4 | ||||
-rw-r--r-- | tests/turandom.c | 4 | ||||
-rw-r--r-- | tests/tyn.c | 2 | ||||
-rw-r--r-- | tests/tzeta.c | 2 | ||||
-rw-r--r-- | tuneup.c | 20 | ||||
-rw-r--r-- | ui_pow_ui.c | 2 | ||||
-rw-r--r-- | urandom.c | 2 | ||||
-rw-r--r-- | urandomb.c | 2 | ||||
-rw-r--r-- | vasprintf.c | 10 | ||||
-rw-r--r-- | yn.c | 6 | ||||
-rw-r--r-- | zeta.c | 4 | ||||
-rw-r--r-- | zeta_ui.c | 2 |
159 files changed, 453 insertions, 450 deletions
@@ -30,8 +30,11 @@ Changes from versions 2.4.* to version 3.0: version 3 or later (LGPL v3+). - Rounding modes GMP_RNDX are now MPFR_RNDX (GMP_RNDX kept for compatibility). - A new rounding mode (MPFR_RNDA) is available to round away from zero. -_ The rounding mode type mp_rnd_t is now mpfr_rnd_t (mp_rnd_t kept for +- The rounding mode type mp_rnd_t is now mpfr_rnd_t (mp_rnd_t kept for compatibility). +- The precision type is now mpfr_prec_t (as in previous versions, both + mpfr_prec_t and mp_prec_t are accepted, but mp_prec_t may be removed + in the future). - Functions mpfr_random and mpfr_random2 have been removed. - mpfr_get_f and mpfr_get_z now return a ternary value. - New functions mpfr_buildopt_tls_p and mpfr_buildopt_decimal_p giving diff --git a/README.dev b/README.dev index 5d95e55cf..12114e002 100644 --- a/README.dev +++ b/README.dev @@ -530,7 +530,7 @@ mpfr_toto (mpfr_ptr rop, mpfr_srcptr op, mpfr_rnd_t rnd) { [Declare all used variables] int inexact; - mp_prec_t prec; + mpfr_prec_t prec; MPFR_ZIV_DECL (loop); MPFR_SAVE_EXPO_DECL (expo); @@ -619,7 +619,7 @@ the new threshold. If it is a classical threshold (not complex), you could use this method (example of mpfr_exp): /* Define the threshold as a variable instead of a constant */ -mp_prec_t mpfr_exp_threshold; +mpfr_prec_t mpfr_exp_threshold; #undef MPFR_EXP_THRESHOLD #define MPFR_EXP_THRESHOLD mpfr_exp_threshold /* Include the test function to threshold directly in the test @@ -28,7 +28,7 @@ mpfr_acos (mpfr_ptr acos, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t xp, arcc, tmp; mp_exp_t supplement; - mp_prec_t prec; + mpfr_prec_t prec; int sign, compared, inexact; MPFR_SAVE_EXPO_DECL (expo); MPFR_ZIV_DECL (loop); @@ -71,8 +71,8 @@ mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mpfr_rnd_t rnd_mode) /* Declaration of the intermediary variables */ mpfr_t t; /* Declaration of the size variables */ - mp_prec_t Ny = MPFR_PREC(y); /* Precision of output variable */ - mp_prec_t Nt; /* Precision of the intermediary variable */ + mpfr_prec_t Ny = MPFR_PREC(y); /* Precision of output variable */ + mpfr_prec_t Nt; /* Precision of the intermediary variable */ mp_exp_t err, exp_te, d; /* Precision of error */ MPFR_ZIV_DECL (loop); @@ -94,7 +94,7 @@ mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mpfr_rnd_t rnd_mode) if (MPFR_OVERFLOW (flags)) { mpfr_t ln2; - mp_prec_t pln2; + mpfr_prec_t pln2; /* As x is very large and the precision is not too large, we assume that we obtain the same result by evaluating ln(2x). @@ -28,7 +28,7 @@ int mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mp_limb_t *ap, *bp, *cp; - mp_prec_t aq, bq, cq, aq2; + mpfr_prec_t aq, bq, cq, aq2; mp_size_t an, bn, cn; mp_exp_t difw, exp; int sh, rb, fb, inex; @@ -44,7 +44,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) cq = MPFR_PREC(c); an = (aq-1)/GMP_NUMB_BITS+1; /* number of limbs of a */ - aq2 = (mp_prec_t) an * GMP_NUMB_BITS; + aq2 = (mpfr_prec_t) an * GMP_NUMB_BITS; sh = aq2 - aq; /* non-significant bits in low limb */ bn = (bq-1)/GMP_NUMB_BITS+1; /* number of limbs of b */ @@ -112,7 +112,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { /* c overlaps with a' */ mp_limb_t *a2p; mp_limb_t cc; - mp_prec_t dif; + mpfr_prec_t dif; mp_size_t difn, k; int shift; @@ -87,7 +87,7 @@ int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mpfr_uexp_t d; - mp_prec_t p; + mpfr_prec_t p; unsigned int sh; mp_size_t n; mp_limb_t *ap, *cp; @@ -29,7 +29,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) { int compare, inexact; mp_size_t s; - mp_prec_t p, q; + mpfr_prec_t p, q; mp_limb_t *up, *vp, *tmpp; mpfr_t u, v, tmp; unsigned long n; /* number of iterations */ @@ -109,7 +109,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) MPFR_ZIV_INIT (loop, p); for (;;) { - mp_prec_t eq; + mpfr_prec_t eq; /* Init temporary vars */ MPFR_TMP_INIT (up, u, p, s); @@ -27,7 +27,7 @@ mpfr_asin (mpfr_ptr asin, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t xp; int compared, inexact; - mp_prec_t prec; + mpfr_prec_t prec; mp_exp_t xp_exp; MPFR_SAVE_EXPO_DECL (expo); MPFR_ZIV_DECL (loop); @@ -31,7 +31,7 @@ mpfr_asinh (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { int inexact; int signx, neg; - mp_prec_t Ny, Nt; + mpfr_prec_t Ny, Nt; mpfr_t t; /* auxiliary variables */ mp_exp_t err; MPFR_SAVE_EXPO_DECL (expo); @@ -41,12 +41,12 @@ mpfr_atan_aux (mpfr_ptr y, mpz_ptr p, long r, int m, mpz_t *tab) unsigned long n, i, k, j, l; mp_exp_t diff, expo; int im, done; - mp_prec_t mult, *accu, *log2_nb_terms; - mp_prec_t precy = MPFR_PREC(y); + mpfr_prec_t mult, *accu, *log2_nb_terms; + mpfr_prec_t precy = MPFR_PREC(y); MPFR_ASSERTD(mpz_cmp_ui (p, 0) != 0); - accu = (mp_prec_t*) (*__gmp_allocate_func) ((2 * m + 2) * sizeof (mp_prec_t)); + accu = (mpfr_prec_t*) (*__gmp_allocate_func) ((2 * m + 2) * sizeof (mpfr_prec_t)); log2_nb_terms = accu + m + 1; /* Set Tables */ @@ -163,7 +163,7 @@ mpfr_atan_aux (mpfr_ptr y, mpz_ptr p, long r, int m, mpz_t *tab) mpz_add (S[k-1], S[k-1], S[k]); mpz_mul (Q[k-1], Q[k-1], Q[k]); } - (*__gmp_free_func) (accu, (2 * m + 2) * sizeof (mp_prec_t)); + (*__gmp_free_func) (accu, (2 * m + 2) * sizeof (mpfr_prec_t)); MPFR_MPZ_SIZEINBASE2 (diff, S[0]); diff -= 2 * precy; @@ -193,7 +193,7 @@ mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mpfr_rnd_t rnd_mode) mpz_t ukz; mpz_t *tabz; mp_exp_t exptol; - mp_prec_t prec, realprec, est_lost, lost; + mpfr_prec_t prec, realprec, est_lost, lost; unsigned long twopoweri, log2p, red; int comparaison, inexact; int i, n0, oldn0; @@ -278,7 +278,7 @@ mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { /* First, if |x| < 1, we need to have more prec to be able to round (sup) n0 = ceil(log(prec_requested + 2 + 1+ln(2.4)/ln(2))/log(2)) */ - mp_prec_t sup; + mpfr_prec_t sup; sup = MPFR_GET_EXP (xp) < 0 ? 2 - MPFR_GET_EXP (xp) : 1; /* sup >= 1 */ n0 = MPFR_INT_CEIL_LOG2 ((realprec + sup) + 3); @@ -28,7 +28,7 @@ mpfr_atan2 (mpfr_ptr dest, mpfr_srcptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t tmp, pi; int inexact; - mp_prec_t prec; + mpfr_prec_t prec; mp_exp_t e; MPFR_SAVE_EXPO_DECL (expo); MPFR_ZIV_DECL (loop); @@ -123,7 +123,7 @@ mpfr_atan2 (mpfr_ptr dest, mpfr_srcptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t tmp2; MPFR_ZIV_DECL (loop2); - mp_prec_t prec2 = MPFR_PREC (dest) + 10; + mpfr_prec_t prec2 = MPFR_PREC (dest) + 10; mpfr_init2 (tmp2, prec2); MPFR_ZIV_INIT (loop2, prec2); @@ -31,7 +31,7 @@ mpfr_atanh (mpfr_ptr y, mpfr_srcptr xt , mpfr_rnd_t rnd_mode) { int inexact; mpfr_t x, t, te; - mp_prec_t Nx, Ny, Nt; + mpfr_prec_t Nx, Ny, Nt; mp_exp_t err; MPFR_ZIV_DECL (loop); MPFR_SAVE_EXPO_DECL (expo); @@ -45,8 +45,8 @@ mpfr_clear_cache (mpfr_cache_t cache) int mpfr_cache (mpfr_ptr dest, mpfr_cache_t cache, mpfr_rnd_t rnd) { - mp_prec_t prec = MPFR_PREC (dest); - mp_prec_t pold = MPFR_PREC (cache->x); + mpfr_prec_t prec = MPFR_PREC (dest); + mpfr_prec_t pold = MPFR_PREC (cache->x); int inexact, sign; MPFR_SAVE_EXPO_DECL (expo); @@ -46,7 +46,7 @@ mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpz_t m; mp_exp_t e, r, sh; - mp_prec_t n, size_m, tmp; + mpfr_prec_t n, size_m, tmp; int inexact, negative; MPFR_SAVE_EXPO_DECL (expo); @@ -47,7 +47,7 @@ mpfr_check (mpfr_srcptr x) /* Check size of mantissa */ s = MPFR_GET_ALLOC_SIZE(x); if (s<=0 || s > MP_SIZE_T_MAX || - MPFR_PREC(x) > ((mp_prec_t)s*GMP_NUMB_BITS)) + MPFR_PREC(x) > ((mpfr_prec_t)s*GMP_NUMB_BITS)) return 0; /* Acces all the mp_limb of the mantissa: may do a seg fault */ for(i = 0 ; i < s ; i++) @@ -34,12 +34,12 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) +mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mpfr_prec_t *cancel) { mp_limb_t *bp, *cp, bb, cc = 0, lastc = 0, dif, high_dif = 0; mp_size_t bn, cn; mpfr_uexp_t diff_exp; - mp_prec_t res = 0; + mpfr_prec_t res = 0; int sign; /* b=c should not happen, since cmp2 is called only from agm diff --git a/const_catalan.c b/const_catalan.c index 89f624cfd..0a14843fe 100644 --- a/const_catalan.c +++ b/const_catalan.c @@ -86,7 +86,7 @@ mpfr_const_catalan_internal (mpfr_ptr g, mpfr_rnd_t rnd_mode) { mpfr_t x, y, z; mpz_t T, P, Q; - mp_prec_t pg, p; + mpfr_prec_t pg, p; int inex; MPFR_ZIV_DECL (loop); MPFR_GROUP_DECL (group); diff --git a/const_euler.c b/const_euler.c index 98f26059f..b5d810325 100644 --- a/const_euler.c +++ b/const_euler.c @@ -40,7 +40,7 @@ static void mpfr_const_euler_R (mpfr_ptr, unsigned long); int mpfr_const_euler_internal (mpfr_t x, mpfr_rnd_t rnd) { - mp_prec_t prec = MPFR_PREC(x), m, log2m; + mpfr_prec_t prec = MPFR_PREC(x), m, log2m; mpfr_t y, z; unsigned long n; int inexact; diff --git a/const_log2.c b/const_log2.c index be0a5a873..8d74286a8 100644 --- a/const_log2.c +++ b/const_log2.c @@ -106,7 +106,7 @@ int mpfr_const_log2_internal (mpfr_ptr x, mpfr_rnd_t rnd_mode) { unsigned long n = MPFR_PREC (x); - mp_prec_t w; /* working precision */ + mpfr_prec_t w; /* working precision */ unsigned long N; mpz_t *T, *P, *Q; mpfr_t t, q; diff --git a/const_pi.c b/const_pi.c index 8ae033397..726fd7fe4 100644 --- a/const_pi.c +++ b/const_pi.c @@ -37,7 +37,7 @@ int mpfr_const_pi_internal (mpfr_ptr x, mpfr_rnd_t rnd_mode) { mpfr_t a, A, B, D, S; - mp_prec_t px, p, cancel, k, kmax; + mpfr_prec_t px, p, cancel, k, kmax; MPFR_ZIV_DECL (loop); int inex; @@ -42,7 +42,7 @@ mpfr_cos2_aux (mpfr_ptr f, mpfr_srcptr r) { mpz_t x, t, s; mp_exp_t ex, l, m; - mp_prec_t p, q; + mpfr_prec_t p, q; unsigned long i, maxi, imax; MPFR_ASSERTD(mpfr_get_exp (r) <= -1); @@ -130,7 +130,7 @@ mpfr_cos2_aux (mpfr_ptr f, mpfr_srcptr r) int mpfr_cos (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { - mp_prec_t K0, K, precy, m, k, l; + mpfr_prec_t K0, K, precy, m, k, l; int inexact, reduce = 0; mpfr_t r, s, xr, c; mp_exp_t exps, cancel = 0, expx; @@ -70,8 +70,8 @@ mpfr_cosh (mpfr_ptr y, mpfr_srcptr xt , mpfr_rnd_t rnd_mode) /* Declaration of the intermediary variable */ mpfr_t t, te; /* Declaration of the size variable */ - mp_prec_t Ny = MPFR_PREC(y); /* Precision of output variable */ - mp_prec_t Nt; /* Precision of the intermediary variable */ + mpfr_prec_t Ny = MPFR_PREC(y); /* Precision of output variable */ + mpfr_prec_t Nt; /* Precision of the intermediary variable */ long int err; /* Precision of error */ MPFR_ZIV_DECL (loop); MPFR_GROUP_DECL (group); @@ -31,7 +31,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static mp_exp_t mpfr_digamma_approx (mpfr_ptr s, mpfr_srcptr x) { - mp_prec_t p = MPFR_PREC (s); + mpfr_prec_t p = MPFR_PREC (s); mpfr_t t, u, invxx; mp_exp_t e, exps, f, expu; mpz_t *INITIALIZED(B); /* variable B declared as initialized */ @@ -120,7 +120,7 @@ mpfr_digamma_approx (mpfr_ptr s, mpfr_srcptr x) static int mpfr_digamma_reflection (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { - mp_prec_t p = MPFR_PREC(y) + 10, q; + mpfr_prec_t p = MPFR_PREC(y) + 10, q; mpfr_t t, u, v; mp_exp_t e1, expv; int inex; @@ -201,7 +201,7 @@ mpfr_digamma_reflection (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) static int mpfr_digamma_positive (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { - mp_prec_t p = MPFR_PREC(y) + 10, q; + mpfr_prec_t p = MPFR_PREC(y) + 10, q; mpfr_t t, u, x_plus_j; int inex; mp_exp_t errt, erru, expt; @@ -39,7 +39,7 @@ mpfr_eint_aux (mpfr_t y, mpfr_srcptr x) mpfr_t erru, errs; mpz_t m, s, t, u; mp_exp_t e, sizeinbase; - mp_prec_t w = MPFR_PREC(y); + mpfr_prec_t w = MPFR_PREC(y); unsigned long k; MPFR_GROUP_DECL (group); @@ -151,7 +151,7 @@ mpfr_eint_aux (mpfr_t y, mpfr_srcptr x) static mp_exp_t mpfr_eint_asympt (mpfr_ptr y, mpfr_srcptr x) { - mp_prec_t p = MPFR_PREC(y); + mpfr_prec_t p = MPFR_PREC(y); mpfr_t invx, t, err; unsigned long k; mp_exp_t err_exp; @@ -196,7 +196,7 @@ mpfr_eint (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) int inex; mpfr_t tmp, ump; mp_exp_t err, te; - mp_prec_t prec; + mpfr_prec_t prec; MPFR_SAVE_EXPO_DECL (expo); MPFR_ZIV_DECL (loop); @@ -180,7 +180,7 @@ mul_2exp (double x, mp_exp_t e) static int mpfr_erf_0 (mpfr_ptr res, mpfr_srcptr x, double xf2, mpfr_rnd_t rnd_mode) { - mp_prec_t n, m; + mpfr_prec_t n, m; mp_exp_t nuk, sigmak; double tauk; mpfr_t y, s, t, u; @@ -192,7 +192,7 @@ mpfr_erf_0 (mpfr_ptr res, mpfr_srcptr x, double xf2, mpfr_rnd_t rnd_mode) n = MPFR_PREC (res); /* target precision */ /* initial working precision */ - m = n + (mp_prec_t) (xf2 / LOG2) + 8 + MPFR_INT_CEIL_LOG2 (n); + m = n + (mpfr_prec_t) (xf2 / LOG2) + 8 + MPFR_INT_CEIL_LOG2 (n); mpfr_init2 (y, m); mpfr_init2 (s, m); @@ -35,7 +35,7 @@ mpfr_erfc_asympt (mpfr_ptr y, mpfr_srcptr x) { mpfr_t t, xx, err; unsigned long k; - mp_prec_t prec = MPFR_PREC(y); + mpfr_prec_t prec = MPFR_PREC(y); mp_exp_t exp_err; mpfr_init2 (t, prec); @@ -126,7 +126,7 @@ mpfr_erfc (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) int inex; mpfr_t tmp; mp_exp_t te, err; - mp_prec_t prec; + mpfr_prec_t prec; MPFR_SAVE_EXPO_DECL (expo); MPFR_ZIV_DECL (loop); diff --git a/examples/rndo-add.c b/examples/rndo-add.c index 89308b58c..72e96a4d5 100644 --- a/examples/rndo-add.c +++ b/examples/rndo-add.c @@ -39,7 +39,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int main (int argc, char **argv) { mpfr_t LIST; - mp_prec_t prec; + mpfr_prec_t prec; int pprec; /* will be prec - 1 for mpfr_printf */ if (argc != 4) @@ -28,7 +28,7 @@ int mpfr_exp (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mp_exp_t expx; - mp_prec_t precy; + mpfr_prec_t precy; int inexact; MPFR_SAVE_EXPO_DECL (expo); @@ -132,7 +132,7 @@ mpfr_exp (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) int sh; yn = 1 + (MPFR_PREC(y) - 1) / GMP_NUMB_BITS; - sh = (mp_prec_t) yn * GMP_NUMB_BITS - MPFR_PREC(y); + sh = (mpfr_prec_t) yn * GMP_NUMB_BITS - MPFR_PREC(y); MPFR_MANT(y)[0] += MPFR_LIMB_ONE << sh; inexact = 1; } @@ -99,8 +99,8 @@ mpfr_exp2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) mpfr_t t; /* Declaration of the size variable */ - mp_prec_t Ny = MPFR_PREC(y); /* target precision */ - mp_prec_t Nt; /* working precision */ + mpfr_prec_t Ny = MPFR_PREC(y); /* target precision */ + mpfr_prec_t Nt; /* working precision */ mp_exp_t err; /* error */ MPFR_ZIV_DECL (loop); @@ -40,13 +40,13 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ static void mpfr_exp_rational (mpfr_ptr y, mpz_ptr p, long r, int m, - mpz_t *Q, mp_prec_t *mult) + mpz_t *Q, mpfr_prec_t *mult) { unsigned long n, i, j; mpz_t *S, *ptoj; - mp_prec_t *log2_nb_terms; + mpfr_prec_t *log2_nb_terms; mp_exp_t diff, expo; - mp_prec_t precy = MPFR_PREC(y), prec_i_have, prec_ptoj; + mpfr_prec_t precy = MPFR_PREC(y), prec_i_have, prec_ptoj; int k, l; MPFR_ASSERTN ((size_t) m < sizeof (long) * CHAR_BIT - 1); @@ -135,7 +135,7 @@ mpfr_exp_rational (mpfr_ptr y, mpz_ptr p, long r, int m, mpz_mul_2exp (S[0], S[0], -diff); MPFR_MPZ_SIZEINBASE2 (prec_i_have, Q[0]); - diff = (mp_exp_t) prec_i_have - (mp_prec_t) precy; + diff = (mp_exp_t) prec_i_have - (mpfr_prec_t) precy; expo -= diff; if (diff > 0) mpz_fdiv_q_2exp (Q[0], Q[0], diff); @@ -157,10 +157,10 @@ mpfr_exp_3 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) mp_exp_t ttt, shift_x; unsigned long twopoweri; mpz_t *P; - mp_prec_t *mult; + mpfr_prec_t *mult; int i, k, loop; int prec_x; - mp_prec_t realprec, Prec; + mpfr_prec_t realprec, Prec; int iter; int inexact = 0; MPFR_SAVE_EXPO_DECL (expo); @@ -216,7 +216,7 @@ mpfr_exp_3 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) P = (mpz_t*) (*__gmp_allocate_func) (3*(k+2)*sizeof(mpz_t)); for (i = 0; i < 3*(k+2); i++) mpz_init (P[i]); - mult = (mp_prec_t*) (*__gmp_allocate_func) (2*(k+2)*sizeof(mp_prec_t)); + mult = (mpfr_prec_t*) (*__gmp_allocate_func) (2*(k+2)*sizeof(mpfr_prec_t)); /* Particular case for i==0 */ mpfr_extract (uk, x_copy, 0); @@ -244,7 +244,7 @@ mpfr_exp_3 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) for (i = 0; i < 3*(k+2); i++) mpz_clear (P[i]); (*__gmp_free_func) (P, 3*(k+2)*sizeof(mpz_t)); - (*__gmp_free_func) (mult, 2*(k+2)*sizeof(mp_prec_t)); + (*__gmp_free_func) (mult, 2*(k+2)*sizeof(mpfr_prec_t)); if (shift_x > 0) { @@ -26,9 +26,9 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" static unsigned long -mpfr_exp2_aux (mpz_t, mpfr_srcptr, mp_prec_t, mp_exp_t *); +mpfr_exp2_aux (mpz_t, mpfr_srcptr, mpfr_prec_t, mp_exp_t *); static unsigned long -mpfr_exp2_aux2 (mpz_t, mpfr_srcptr, mp_prec_t, mp_exp_t *); +mpfr_exp2_aux2 (mpz_t, mpfr_srcptr, mpfr_prec_t, mp_exp_t *); static mp_exp_t mpz_normalize (mpz_t, mpz_t, mp_exp_t); static mp_exp_t @@ -86,7 +86,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) unsigned long K, k, l, err; /* FIXME: Which type ? */ int error_r; mp_exp_t exps; - mp_prec_t q, precy; + mpfr_prec_t q, precy; int inexact; mpfr_t r, s; mpz_t ss; @@ -248,7 +248,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) since mpz_mul_2exp(s, s, q-1) reallocates qn+1 limbs) */ static unsigned long -mpfr_exp2_aux (mpz_t s, mpfr_srcptr r, mp_prec_t q, mp_exp_t *exps) +mpfr_exp2_aux (mpz_t s, mpfr_srcptr r, mpfr_prec_t q, mp_exp_t *exps) { unsigned long l; mp_exp_t dif, expt, expr; @@ -306,11 +306,11 @@ mpfr_exp2_aux (mpz_t s, mpfr_srcptr r, mp_prec_t q, mp_exp_t *exps) The error is bounded by (l^2+4*l) ulps where l is the return value. */ static unsigned long -mpfr_exp2_aux2 (mpz_t s, mpfr_srcptr r, mp_prec_t q, mp_exp_t *exps) +mpfr_exp2_aux2 (mpz_t s, mpfr_srcptr r, mpfr_prec_t q, mp_exp_t *exps) { mp_exp_t expr, *expR, expt; mp_size_t sizer; - mp_prec_t ql; + mpfr_prec_t ql; unsigned long l, m, i; mpz_t t, *R, rr, tmp; mp_size_t sbit, rrbit; @@ -103,8 +103,8 @@ mpfr_expm1 (mpfr_ptr y, mpfr_srcptr x , mpfr_rnd_t rnd_mode) /* Declaration of the intermediary variable */ mpfr_t t; /* Declaration of the size variable */ - mp_prec_t Ny = MPFR_PREC(y); /* target precision */ - mp_prec_t Nt; /* working precision */ + mpfr_prec_t Ny = MPFR_PREC(y); /* target precision */ + mpfr_prec_t Nt; /* working precision */ mp_exp_t err, exp_te; /* error */ MPFR_ZIV_DECL (loop); diff --git a/factorial.c b/factorial.c index 7d852fb9e..1ef2b3fbb 100644 --- a/factorial.c +++ b/factorial.c @@ -37,9 +37,9 @@ mpfr_fac_ui (mpfr_ptr y, unsigned long int x, mpfr_rnd_t rnd_mode) unsigned long i; int round, inexact; - mp_prec_t Ny; /* Precision of output variable */ - mp_prec_t Nt; /* Precision of Intermediary Calculation variable */ - mp_prec_t err; /* Precision of error */ + mpfr_prec_t Ny; /* Precision of output variable */ + mpfr_prec_t Nt; /* Precision of Intermediary Calculation variable */ + mpfr_prec_t err; /* Precision of error */ mpfr_rnd_t rnd; MPFR_SAVE_EXPO_DECL (expo); diff --git a/fits_intmax.c b/fits_intmax.c index f4856893d..6653e943c 100644 --- a/fits_intmax.c +++ b/fits_intmax.c @@ -48,7 +48,7 @@ int mpfr_fits_intmax_p (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_exp_t exp; - mp_prec_t prec; + mpfr_prec_t prec; intmax_t s; mpfr_t x, y; int neg; @@ -27,7 +27,7 @@ int FUNCTION (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_exp_t exp; - mp_prec_t prec; + mpfr_prec_t prec; TYPE s; mpfr_t x; int neg; @@ -26,7 +26,7 @@ int FUNCTION (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_exp_t exp; - mp_prec_t prec; + mpfr_prec_t prec; TYPE s; mpfr_t x; int res; diff --git a/fits_uintmax.c b/fits_uintmax.c index 5db850e8c..016a3d037 100644 --- a/fits_uintmax.c +++ b/fits_uintmax.c @@ -48,7 +48,7 @@ int mpfr_fits_uintmax_p (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_exp_t exp; - mp_prec_t prec; + mpfr_prec_t prec; uintmax_t s; mpfr_t x, y; int res; @@ -198,7 +198,7 @@ mpfr_fma (mpfr_ptr s, mpfr_srcptr x, mpfr_srcptr y, mpfr_srcptr z, mpfr_t scaled_z; mpfr_srcptr new_z; mp_exp_t diffexp; - mp_prec_t pzs; + mpfr_prec_t pzs; int xy_underflows; /* Let's scale z so that ulp(z) > 2^emin and ulp(s) > 2^emin @@ -200,7 +200,7 @@ mpfr_fms (mpfr_ptr s, mpfr_srcptr x, mpfr_srcptr y, mpfr_srcptr z, mpfr_t scaled_z; mpfr_srcptr new_z; mp_exp_t diffexp; - mp_prec_t pzs; + mpfr_prec_t pzs; int xy_underflows; /* Let's scale z so that ulp(z) > 2^emin and ulp(s) > 2^emin @@ -31,7 +31,7 @@ int mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) { mp_exp_t re, ue; - mp_prec_t uq; + mpfr_prec_t uq; mp_size_t un, tn, t0; mp_limb_t *up, *tp, k; int sh; @@ -129,7 +129,7 @@ mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) MPFR_EXP (r) = re; carry = mpfr_round_raw (tp, tp, - (mp_prec_t) (tn + 1) * GMP_NUMB_BITS, + (mpfr_prec_t) (tn + 1) * GMP_NUMB_BITS, MPFR_IS_NEG (r), MPFR_PREC (r), rnd_mode, &inex); if (carry) @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #undef IS_GAMMA /* return a sufficient precision such that 2-x is exact, assuming x < 0 */ -static mp_prec_t +static mpfr_prec_t mpfr_gamma_2_minus_x_exact (mpfr_srcptr x) { /* Since x < 0, 2-x = 2+y with y := -x. @@ -45,7 +45,7 @@ mpfr_gamma_2_minus_x_exact (mpfr_srcptr x) } /* return a sufficient precision such that 1-x is exact, assuming x < 1 */ -static mp_prec_t +static mpfr_prec_t mpfr_gamma_1_minus_x_exact (mpfr_srcptr x) { if (MPFR_IS_POS(x)) @@ -99,7 +99,7 @@ mpfr_gamma (mpfr_ptr gamma, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t xp, GammaTrial, tmp, tmp2; mpz_t fact; - mp_prec_t realprec; + mpfr_prec_t realprec; int compared, inex, is_integer; MPFR_GROUP_DECL (group); MPFR_SAVE_EXPO_DECL (expo); @@ -213,7 +213,7 @@ mpfr_gamma (mpfr_ptr gamma, mpfr_srcptr x, mpfr_rnd_t rnd_mode) if (is_integer && mpfr_fits_ulong_p (x, MPFR_RNDN)) { unsigned long int u; - mp_prec_t p = MPFR_PREC(gamma); + mpfr_prec_t p = MPFR_PREC(gamma); u = mpfr_get_ui (x, MPFR_RNDN); if (u < 44787929UL && bits_fac (u - 1) <= p + (rnd_mode == MPFR_RNDN)) /* bits_fac: lower bound on the number of bits of m, @@ -266,7 +266,7 @@ mpfr_gamma (mpfr_ptr gamma, mpfr_srcptr x, mpfr_rnd_t rnd_mode) if (MPFR_IS_NEG(x)) { int underflow = 0, sgn, ck; - mp_prec_t w; + mpfr_prec_t w; mpfr_init2 (xp, 53); mpfr_init2 (tmp, 53); @@ -321,7 +321,7 @@ mpfr_gamma (mpfr_ptr gamma, mpfr_srcptr x, mpfr_rnd_t rnd_mode) realprec = MPFR_PREC (gamma); /* we want both 1-x and 2-x to be exact */ { - mp_prec_t w; + mpfr_prec_t w; w = mpfr_gamma_1_minus_x_exact (x); if (realprec < w) realprec = w; diff --git a/gen_inverse.h b/gen_inverse.h index 2562dd93a..810959425 100644 --- a/gen_inverse.h +++ b/gen_inverse.h @@ -43,8 +43,8 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int FUNCTION (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { - mp_prec_t precy; /* target precision */ - mp_prec_t m; /* working precision */ + mpfr_prec_t precy; /* target precision */ + mpfr_prec_t m; /* working precision */ mpfr_t z; /* temporary variable to store INVERSE(x) */ int inexact; /* inexact flag */ MPFR_ZIV_DECL (loop); @@ -31,7 +31,7 @@ mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) { int inex; mp_size_t sx, sy; - mp_prec_t precx, precy; + mpfr_prec_t precx, precy; mp_limb_t *xp; int sh; @@ -78,7 +78,7 @@ mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) sx = PREC(x); /* number of limbs of the mantissa of x */ precy = MPFR_PREC(y); - precx = (mp_prec_t) sx * GMP_NUMB_BITS; + precx = (mpfr_prec_t) sx * GMP_NUMB_BITS; sy = MPFR_LIMB_SIZE (y); xp = PTR (x); @@ -115,7 +115,7 @@ mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) mpfr_t z; mp_size_t sz; - /* Recall that precx = (mp_prec_t) sx * GMP_NUMB_BITS, thus removing + /* Recall that precx = (mpfr_prec_t) sx * GMP_NUMB_BITS, thus removing sh bits (sh < GMP_NUMB_BITSS) won't reduce the number of limbs. */ mpfr_init2 (z, precx - sh); sz = MPFR_LIMB_SIZE (z); @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., long mpfr_get_si (mpfr_srcptr f, mpfr_rnd_t rnd) { - mp_prec_t prec; + mpfr_prec_t prec; long s; mpfr_t x; @@ -47,7 +47,7 @@ intmax_t mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd) { intmax_t r; - mp_prec_t prec; + mpfr_prec_t prec; mpfr_t x; if (!mpfr_fits_intmax_p (f, rnd)) @@ -80,9 +80,9 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd) xp = MPFR_MANT (x); sh = MPFR_GET_EXP (x); - MPFR_ASSERTN ((mp_prec_t) sh <= prec); + MPFR_ASSERTN ((mpfr_prec_t) sh <= prec); if (INTMAX_MIN + INTMAX_MAX != 0 - && MPFR_UNLIKELY ((mp_prec_t) sh == prec)) + && MPFR_UNLIKELY ((mpfr_prec_t) sh == prec)) { /* 2's complement and x <= INTMAX_MIN: in the case mp_limb_t has the same size as intmax_t, we cannot use the code in @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., unsigned long mpfr_get_ui (mpfr_srcptr f, mpfr_rnd_t rnd) { - mp_prec_t prec; + mpfr_prec_t prec; unsigned long s; mpfr_t x; mp_size_t n; @@ -47,7 +47,7 @@ uintmax_t mpfr_get_uj (mpfr_srcptr f, mpfr_rnd_t rnd) { uintmax_t r; - mp_prec_t prec; + mpfr_prec_t prec; mpfr_t x; if (!mpfr_fits_uintmax_p (f, rnd)) @@ -77,7 +77,7 @@ mpfr_get_uj (mpfr_srcptr f, mpfr_rnd_t rnd) MPFR_ASSERTN (MPFR_IS_POS (x)); xp = MPFR_MANT (x); sh = MPFR_GET_EXP (x); - MPFR_ASSERTN ((mp_prec_t) sh <= prec); + MPFR_ASSERTN ((mpfr_prec_t) sh <= prec); for (n = MPFR_LIMB_SIZE(x) - 1; n >= 0; n--) { sh -= GMP_NUMB_BITS; @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static void init_set_z (mpfr_ptr t, mpz_srcptr z) { - mp_prec_t p; + mpfr_prec_t p; int i; if (mpz_size (z) <= 1) @@ -101,7 +101,7 @@ mpfr_mul_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mpfr_rnd_t rnd_mode) { mpfr_t tmp; int res; - mp_prec_t p; + mpfr_prec_t p; if (MPFR_UNLIKELY (mpq_sgn (z) == 0)) return mpfr_mul_ui (y, x, 0, rnd_mode); @@ -122,7 +122,7 @@ mpfr_div_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mpfr_rnd_t rnd_mode) { mpfr_t tmp; int res; - mp_prec_t p; + mpfr_prec_t p; if (MPFR_UNLIKELY (mpq_sgn (z) == 0)) return mpfr_div_ui (y, x, 0, rnd_mode); @@ -142,7 +142,7 @@ int mpfr_add_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mpfr_rnd_t rnd_mode) { mpfr_t t,q; - mp_prec_t p; + mpfr_prec_t p; mp_exp_t err; int res; MPFR_ZIV_DECL (loop); @@ -215,7 +215,7 @@ int mpfr_sub_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z,mpfr_rnd_t rnd_mode) { mpfr_t t,q; - mp_prec_t p; + mpfr_prec_t p; int res; mp_exp_t err; MPFR_ZIV_DECL (loop); @@ -295,7 +295,7 @@ mpfr_cmp_q (mpfr_srcptr x, mpq_srcptr z) { mpfr_t t; int res; - mp_prec_t p; + mpfr_prec_t p; /* x < a/b ? <=> x*b < a */ MPFR_ASSERTD (mpz_sgn (mpq_denref (z)) != 0); MPFR_MPZ_SIZEINBASE2 (p, mpq_denref (z)); @@ -31,9 +31,9 @@ mpfr_hypot (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) { int inexact, exact; mpfr_t t, te, ti; /* auxiliary variables */ - mp_prec_t N, Nz; /* size variables */ - mp_prec_t Nt; /* precision of the intermediary variable */ - mp_prec_t threshold; + mpfr_prec_t N, Nz; /* size variables */ + mpfr_prec_t Nt; /* precision of the intermediary variable */ + mpfr_prec_t threshold; mp_exp_t Ex, sh; mpfr_uexp_t diff_exp; @@ -141,7 +141,7 @@ mpfr_hypot (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) MPFR_ZIV_INIT (loop, Nt); for (;;) { - mp_prec_t err; + mpfr_prec_t err; exact = mpfr_mul_2si (te, x, sh, MPFR_RNDZ); exact |= mpfr_mul_2si (ti, y, sh, MPFR_RNDZ); @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" void -mpfr_init2 (mpfr_ptr x, mp_prec_t p) +mpfr_init2 (mpfr_ptr x, mpfr_prec_t p) { mp_size_t xsize; mp_ptr tmp; @@ -35,13 +35,13 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" /* - * Contrary to mpfr_init2, mp_prec_t p is the first argument + * Contrary to mpfr_init2, mpfr_prec_t p is the first argument */ /* Explicit support for K&R compiler */ void #if HAVE_STDARG -mpfr_inits2 (mp_prec_t p, mpfr_ptr x, ...) +mpfr_inits2 (mpfr_prec_t p, mpfr_ptr x, ...) #else mpfr_inits2 (va_alist) va_dcl @@ -51,10 +51,10 @@ mpfr_inits2 (va_alist) #if HAVE_STDARG va_start (arg, x); #else - mp_prec_t p; + mpfr_prec_t p; mpfr_ptr x; va_start(arg); - p = va_arg (arg, mp_prec_t); + p = va_arg (arg, mpfr_prec_t); x = va_arg (arg, mpfr_ptr); #endif while (x != 0) diff --git a/isinteger.c b/isinteger.c index 35cf124f6..73976f5a5 100644 --- a/isinteger.c +++ b/isinteger.c @@ -27,7 +27,7 @@ int mpfr_integer_p (mpfr_srcptr x) { mp_exp_t expo; - mp_prec_t prec; + mpfr_prec_t prec; mp_size_t xn; mp_limb_t *xp; @@ -77,7 +77,7 @@ mpfr_jn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r) { int inex; unsigned long absn; - mp_prec_t prec, pbound, err; + mpfr_prec_t prec, pbound, err; mp_exp_t exps, expT; mpfr_t y, s, t, absz; unsigned long k, zz, k0; diff --git a/jyn_asympt.c b/jyn_asympt.c index 769e40e88..f936f91af 100644 --- a/jyn_asympt.c +++ b/jyn_asympt.c @@ -41,7 +41,7 @@ static int FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r) { mpfr_t s, c, P, Q, t, iz, err_t, err_s, err_u; - mp_prec_t w; + mpfr_prec_t w; long k; int inex, stop, diverge = 0; mp_exp_t err2, err; @@ -135,7 +135,7 @@ static int mpfr_li2_asympt_pos (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t g, h; - mp_prec_t w = MPFR_PREC (y) + 20; + mpfr_prec_t w = MPFR_PREC (y) + 20; int inex = 0; MPFR_ASSERTN (mpfr_cmp_ui (x, 38) >= 0); @@ -181,7 +181,7 @@ static int mpfr_li2_asympt_neg (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t g, h; - mp_prec_t w = MPFR_PREC (y) + 20; + mpfr_prec_t w = MPFR_PREC (y) + 20; int inex = 0; MPFR_ASSERTN (mpfr_cmp_si (x, -7) <= 0); @@ -31,7 +31,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., precision should be >= 4. */ static void -mpfr_gamma_alpha (mpfr_t s, mp_prec_t p) +mpfr_gamma_alpha (mpfr_t s, mpfr_prec_t p) { if (p <= 100) mpfr_set_ui_2exp (s, 614, -10, MPFR_RNDN); /* about 0.6 */ @@ -54,7 +54,7 @@ static int unit_bit (mpfr_srcptr (x)) { mp_exp_t expo; - mp_prec_t prec; + mpfr_prec_t prec; mp_limb_t x0; expo = MPFR_GET_EXP (x); @@ -95,7 +95,7 @@ unit_bit (mpfr_srcptr (x)) static int GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mpfr_rnd_t rnd) { - mp_prec_t precy, w; /* working precision */ + mpfr_prec_t precy, w; /* working precision */ mpfr_t s, t, u, v, z; unsigned long m, k, maxm; mpz_t *INITIALIZED(B); /* variable B declared as initialized */ @@ -123,7 +123,7 @@ GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mpfr_rnd_t rnd) { mpfr_t l, h, g; int ok, inex2; - mp_prec_t prec = MPFR_PREC(y) + 14; + mpfr_prec_t prec = MPFR_PREC(y) + 14; MPFR_ZIV_DECL (loop); MPFR_ZIV_INIT (loop, prec); @@ -592,7 +592,7 @@ mpfr_lgamma (mpfr_ptr y, int *signp, mpfr_srcptr x, mpfr_rnd_t rnd) { mpfr_t l, h; int ok, inex2; - mp_prec_t w = MPFR_PREC (y) + 14; + mpfr_prec_t w = MPFR_PREC (y) + 14; while (1) { @@ -42,7 +42,7 @@ int mpfr_log (mpfr_ptr r, mpfr_srcptr a, mpfr_rnd_t rnd_mode) { int inexact; - mp_prec_t p, q; + mpfr_prec_t p, q; mpfr_t tmp1, tmp2; mp_limb_t *tmp1p, *tmp2p; MPFR_SAVE_EXPO_DECL (expo); @@ -103,7 +103,7 @@ mpfr_log (mpfr_ptr r, mpfr_srcptr a, mpfr_rnd_t rnd_mode) /* use initial precision about q+lg(q)+5 */ p = q + 5 + 2 * MPFR_INT_CEIL_LOG2 (q); - /* % ~(mp_prec_t)GMP_NUMB_BITS ; + /* % ~(mpfr_prec_t)GMP_NUMB_BITS ; m=q; while (m) { p++; m >>= 1; } */ /* if (MPFR_LIKELY(p % GMP_NUMB_BITS != 0)) p += GMP_NUMB_BITS - (p%GMP_NUMB_BITS); */ @@ -90,8 +90,8 @@ mpfr_log10 (mpfr_ptr r, mpfr_srcptr a, mpfr_rnd_t rnd_mode) mpfr_t t, tt; MPFR_ZIV_DECL (loop); /* Declaration of the size variable */ - mp_prec_t Ny = MPFR_PREC(r); /* Precision of output variable */ - mp_prec_t Nt; /* Precision of the intermediary variable */ + mpfr_prec_t Ny = MPFR_PREC(r); /* Precision of output variable */ + mpfr_prec_t Nt; /* Precision of the intermediary variable */ mp_exp_t err; /* Precision of error */ /* compute the precision of intermediary variable */ @@ -97,8 +97,8 @@ mpfr_log1p (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) /* Declaration of the intermediary variable */ mpfr_t t; /* Declaration of the size variable */ - mp_prec_t Ny = MPFR_PREC(y); /* target precision */ - mp_prec_t Nt; /* working precision */ + mpfr_prec_t Ny = MPFR_PREC(y); /* target precision */ + mpfr_prec_t Nt; /* working precision */ mp_exp_t err; /* error */ MPFR_ZIV_DECL (loop); @@ -91,8 +91,8 @@ mpfr_log2 (mpfr_ptr r, mpfr_srcptr a, mpfr_rnd_t rnd_mode) /* Declaration of the intermediary variable */ mpfr_t t, tt; /* Declaration of the size variable */ - mp_prec_t Ny = MPFR_PREC(r); /* target precision */ - mp_prec_t Nt; /* working precision */ + mpfr_prec_t Ny = MPFR_PREC(r); /* target precision */ + mpfr_prec_t Nt; /* working precision */ mp_exp_t err; /* error */ MPFR_ZIV_DECL (loop); @@ -40,7 +40,7 @@ int mpfr_log_level; int mpfr_log_base; int mpfr_log_current; int mpfr_log_worstcase_limit; -mp_prec_t mpfr_log_prec; +mpfr_prec_t mpfr_log_prec; static int mpfr_printf_mpfr_print (FILE *stream, const struct printf_info *info, @@ -51,8 +51,8 @@ mpfr_printf_mpfr_print (FILE *stream, const struct printf_info *info, /* TODO: Use much more flag from info */ mpfr_srcptr w = *((mpfr_srcptr *) (arg[0])); - mp_prec_t prec = mpfr_log_prec != 0 ? mpfr_log_prec - : info->width == -1 ? 0 : (mp_prec_t) info->width; + mpfr_prec_t prec = mpfr_log_prec != 0 ? mpfr_log_prec + : info->width == -1 ? 0 : (mpfr_prec_t) info->width; org_type_logging = mpfr_log_type; mpfr_log_type = 0; /* We disable the logging during this print! */ diff --git a/mbench/mpfr-gfx.c b/mbench/mpfr-gfx.c index 28f8b6472..aa66adc85 100644 --- a/mbench/mpfr-gfx.c +++ b/mbench/mpfr-gfx.c @@ -124,7 +124,7 @@ unsigned long num; mpf_t *xt, *yt, *zt; int smooth = 3; /* (default) minimal number of routine calls for each number */ -void lets_start(unsigned long n, mp_prec_t p) +void lets_start(unsigned long n, mpfr_prec_t p) { unsigned long i; gmp_randstate_t state; @@ -167,7 +167,7 @@ void lets_end(void) free (zt); } -double get_speed(mp_prec_t p, int select) +double get_speed(mpfr_prec_t p, int select) { unsigned long long mc[num], m; mpfr_t a,b,c; @@ -241,12 +241,12 @@ double get_speed(mp_prec_t p, int select) int write_data (const char *filename, unsigned long num, - mp_prec_t p1, mp_prec_t p2, mp_prec_t ps, float pr, + mpfr_prec_t p1, mpfr_prec_t p2, mpfr_prec_t ps, float pr, int select1, int select2, int postscript) { char strf[256], strg[256]; FILE *f, *g; - mp_prec_t p, step; + mpfr_prec_t p, step; int op = 0; lets_start (num, p2); @@ -289,7 +289,7 @@ write_data (const char *filename, get_speed(p, select2)); if (pr != 0.0) { - step = (mp_prec_t) (p * pr - p); + step = (mpfr_prec_t) (p * pr - p); if (step < 1) step = 1; } @@ -310,11 +310,11 @@ write_data (const char *filename, int write_data2 (const char *filename, unsigned long num, - mp_prec_t p_begin, mp_prec_t p_end, mp_prec_t p_step, float p_r, + mpfr_prec_t p_begin, mpfr_prec_t p_end, mpfr_prec_t p_step, float p_r, int s_begin, int s_end) { FILE *f; - mp_prec_t p, step; + mpfr_prec_t p, step; int s; lets_start (num, p_end); @@ -335,7 +335,7 @@ write_data2 (const char *filename, fprintf (f, "\n"); if (p_r != 0.0) { - step = (mp_prec_t) (p * p_r - p); + step = (mpfr_prec_t) (p * p_r - p); if (step < 1) step = 1; } @@ -357,7 +357,7 @@ int op_num (void) int main(int argc, const char *argv[]) { - mp_prec_t p1, p2, ps; + mpfr_prec_t p1, p2, ps; float pr; int i; unsigned long stat; diff --git a/mbench/mpfr-v4.c b/mbench/mpfr-v4.c index c6d6f4cea..5a53ad10e 100644 --- a/mbench/mpfr-v4.c +++ b/mbench/mpfr-v4.c @@ -81,7 +81,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int verbose = 0; -void mpfr_bench(mp_prec_t prec_a, mp_prec_t prec_b, mp_prec_t prec_c, +void mpfr_bench(mpfr_prec_t prec_a, mpfr_prec_t prec_b, mpfr_prec_t prec_c, const char *b_str, const char *c_str, unsigned long seed) { mpfr_t a,b,c; @@ -135,8 +135,8 @@ void mpfr_bench(mp_prec_t prec_a, mp_prec_t prec_b, mp_prec_t prec_c, } #define MAX_OP 40 -void mpfr_stats (unsigned long num, mp_prec_t prec_a, mp_prec_t prec_b, - mp_prec_t prec_c, unsigned long seed) +void mpfr_stats (unsigned long num, mpfr_prec_t prec_a, mpfr_prec_t prec_b, + mpfr_prec_t prec_c, unsigned long seed) { mpf_t xt[num],yt[num],zt[num]; unsigned long long mc[num][MAX_OP], m; @@ -232,7 +232,7 @@ void mpfr_stats (unsigned long num, mp_prec_t prec_a, mp_prec_t prec_b, int main(int argc, const char *argv[]) { - mp_prec_t prec_a, prec_b, prec_c; + mpfr_prec_t prec_a, prec_b, prec_c; unsigned long seed, stat; int i; const char *b_strptr, *c_strptr; diff --git a/mbench/mpfr-v6.c b/mbench/mpfr-v6.c index 89ee648ea..81ea949cd 100644 --- a/mbench/mpfr-v6.c +++ b/mbench/mpfr-v6.c @@ -154,7 +154,7 @@ void mpf_set_fr (mpf_t dest, mpfr_t src, mp_rnd_t rnd) } #define MAX_OP 40 -void make_stats(const char *filename, int num, mp_prec_t prec, int select_op, +void make_stats(const char *filename, int num, mpfr_prec_t prec, int select_op, const char *outputname, int smooth, int granularity) { mpfr_t tab[num+1]; @@ -314,7 +314,7 @@ void make_stats(const char *filename, int num, mp_prec_t prec, int select_op, int main(int argc, const char *argv[]) { - mp_prec_t prec; + mpfr_prec_t prec; unsigned long stat; int i, select_op = -1, smooth = 3, granularity = 10, op; const char *filename = "float.data"; @@ -30,7 +30,7 @@ int mpfr_modf (mpfr_ptr iop, mpfr_ptr fop, mpfr_srcptr op, mpfr_rnd_t rnd_mode) { mp_exp_t ope; - mp_prec_t opq; + mpfr_prec_t opq; int inexi, inexf; MPFR_LOG_FUNC (("op[%#R]=%R rnd=%d", op, op, rnd_mode), diff --git a/mpfr-impl.h b/mpfr-impl.h index c4e0e3b4b..f436512e0 100644 --- a/mpfr-impl.h +++ b/mpfr-impl.h @@ -206,7 +206,7 @@ extern "C" { __MPFR_DECLSPEC extern MPFR_THREAD_ATTR unsigned int __gmpfr_flags; __MPFR_DECLSPEC extern MPFR_THREAD_ATTR mp_exp_t __gmpfr_emin; __MPFR_DECLSPEC extern MPFR_THREAD_ATTR mp_exp_t __gmpfr_emax; -__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mp_prec_t __gmpfr_default_fp_bit_precision; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_prec_t __gmpfr_default_fp_bit_precision; __MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_rnd_t __gmpfr_default_rounding_mode; __MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_pi; __MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_log2; @@ -1127,7 +1127,7 @@ typedef struct { do { \ mp_size_t _dests, _srcs; \ mp_limb_t *_destp; \ - mp_prec_t _destprec, _srcprec; \ + mpfr_prec_t _destprec, _srcprec; \ \ /* Check Trivial Case when Dest Mantissa has more bits than source */ \ _srcprec = sprec; \ @@ -1135,8 +1135,8 @@ typedef struct { _destp = MPFR_MANT (dest); \ if (MPFR_UNLIKELY (_destprec >= _srcprec)) \ { \ - _srcs = (_srcprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS; \ - _dests = (_destprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS - _srcs; \ + _srcs = (_srcprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS; \ + _dests = (_destprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS - _srcs; \ MPN_COPY (_destp + _dests, srcp, _srcs); \ MPN_ZERO (_destp, _dests); \ inexact = 0; \ @@ -1144,17 +1144,17 @@ typedef struct { else \ { \ /* Non trivial case: rounding needed */ \ - mp_prec_t _sh; \ + mpfr_prec_t _sh; \ mp_limb_t *_sp; \ mp_limb_t _rb, _sb, _ulp; \ \ /* Compute Position and shift */ \ - _srcs = (_srcprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS; \ - _dests = (_destprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS; \ + _srcs = (_srcprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS; \ + _dests = (_destprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS; \ MPFR_UNSIGNED_MINUS_MODULO (_sh, _destprec); \ _sp = srcp + _srcs - _dests; \ \ - /* General case when prec % GMP_NUMB_BITS != 0 */ \ + /* General case when prec % GMP_NUMB_BITS != 0 */ \ if (MPFR_LIKELY (_sh != 0)) \ { \ mp_limb_t _mask; \ @@ -1189,7 +1189,7 @@ typedef struct { _ulp = MPFR_LIMB_ONE; \ } \ /* Rounding */ \ - if (MPFR_LIKELY (rnd == MPFR_RNDN)) \ + if (MPFR_LIKELY (rnd == MPFR_RNDN)) \ { \ if (_rb == 0) \ { \ @@ -1354,7 +1354,7 @@ typedef struct { #ifndef MPFR_USE_LOGGING -#define MPFR_ZIV_DECL(_x) mp_prec_t _x +#define MPFR_ZIV_DECL(_x) mpfr_prec_t _x #define MPFR_ZIV_INIT(_x, _p) (_x) = GMP_NUMB_BITS #define MPFR_ZIV_NEXT(_x, _p) ((_p) += (_x), (_x) = (_p)/2) #define MPFR_ZIV_FREE(x) @@ -1371,7 +1371,7 @@ typedef struct { /* Use LOGGING */ #define MPFR_ZIV_DECL(_x) \ - mp_prec_t _x; \ + mpfr_prec_t _x; \ int _x ## _cpt = 1; \ static unsigned long _x ## _loop = 0, _x ## _bad = 0; \ static const char *_x ## _fname = __func__; \ @@ -1433,7 +1433,7 @@ __MPFR_DECLSPEC extern int mpfr_log_type; __MPFR_DECLSPEC extern int mpfr_log_level; __MPFR_DECLSPEC extern int mpfr_log_current; __MPFR_DECLSPEC extern int mpfr_log_base; -__MPFR_DECLSPEC extern mp_prec_t mpfr_log_prec; +__MPFR_DECLSPEC extern mpfr_prec_t mpfr_log_prec; #if defined (__cplusplus) } @@ -1514,12 +1514,12 @@ struct mpfr_group_t { }} while (0) #define MPFR_GROUP_INIT_TEMPLATE(g, prec, num, handler) do { \ - mp_prec_t _prec = (prec); \ + mpfr_prec_t _prec = (prec); \ mp_size_t _size; \ MPFR_ASSERTD (_prec >= MPFR_PREC_MIN); \ if (MPFR_UNLIKELY (_prec > MPFR_PREC_MAX)) \ mpfr_abort_prec_max (); \ - _size = (mp_prec_t) (_prec + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS; \ + _size = (mpfr_prec_t) (_prec + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS; \ if (MPFR_UNLIKELY (_size * (num) > MPFR_GROUP_STATIC_SIZE)) \ { \ (g).alloc = (num) * _size * sizeof (mp_limb_t); \ @@ -1560,13 +1560,13 @@ struct mpfr_group_t { MPFR_GROUP_TINIT(g, 4, a);MPFR_GROUP_TINIT(g, 5, b)) #define MPFR_GROUP_REPREC_TEMPLATE(g, prec, num, handler) do { \ - mp_prec_t _prec = (prec); \ + mpfr_prec_t _prec = (prec); \ size_t _oalloc = (g).alloc; \ mp_size_t _size; \ MPFR_ASSERTD (_prec >= MPFR_PREC_MIN); \ if (MPFR_UNLIKELY (_prec > MPFR_PREC_MAX)) \ mpfr_abort_prec_max (); \ - _size = (mp_prec_t) (_prec + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS; \ + _size = (mpfr_prec_t) (_prec + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS; \ (g).alloc = (num) * _size * sizeof (mp_limb_t); \ if (MPFR_LIKELY (_oalloc == 0)) \ (g).mant = (mp_limb_t *) (*__gmp_allocate_func) ((g).alloc); \ @@ -1621,10 +1621,10 @@ __MPFR_DECLSPEC int mpfr_add1sp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, __MPFR_DECLSPEC int mpfr_sub1sp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_can_round_raw _MPFR_PROTO ((const mp_limb_t *, - mp_size_t, int, mp_exp_t, mpfr_rnd_t, mpfr_rnd_t, mp_prec_t)); + mp_size_t, int, mp_exp_t, mpfr_rnd_t, mpfr_rnd_t, mpfr_prec_t)); __MPFR_DECLSPEC int mpfr_cmp2 _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr, - mp_prec_t *)); + mpfr_prec_t *)); __MPFR_DECLSPEC long __gmpfr_ceil_log2 _MPFR_PROTO ((double)); __MPFR_DECLSPEC long __gmpfr_floor_log2 _MPFR_PROTO ((double)); @@ -1651,17 +1651,17 @@ __MPFR_DECLSPEC void mpfr_fprint_binary _MPFR_PROTO ((FILE *, mpfr_srcptr)); #endif __MPFR_DECLSPEC void mpfr_print_binary _MPFR_PROTO ((mpfr_srcptr)); __MPFR_DECLSPEC void mpfr_print_mant_binary _MPFR_PROTO ((const char*, - const mp_limb_t*, mp_prec_t)); + const mp_limb_t*, mpfr_prec_t)); __MPFR_DECLSPEC void mpfr_set_str_binary _MPFR_PROTO((mpfr_ptr, const char*)); __MPFR_DECLSPEC int mpfr_round_raw _MPFR_PROTO ((mp_limb_t *, - const mp_limb_t *, mp_prec_t, int, mp_prec_t, mpfr_rnd_t, int *)); + const mp_limb_t *, mpfr_prec_t, int, mpfr_prec_t, mpfr_rnd_t, int *)); __MPFR_DECLSPEC int mpfr_round_raw_2 _MPFR_PROTO ((const mp_limb_t *, - mp_prec_t, int, mp_prec_t, mpfr_rnd_t)); + mpfr_prec_t, int, mpfr_prec_t, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_round_raw_3 _MPFR_PROTO ((const mp_limb_t *, - mp_prec_t, int, mp_prec_t, mpfr_rnd_t, int *)); + mpfr_prec_t, int, mpfr_prec_t, mpfr_rnd_t, int *)); __MPFR_DECLSPEC int mpfr_round_raw_4 _MPFR_PROTO ((mp_limb_t *, - const mp_limb_t *, mp_prec_t, int, mp_prec_t, mpfr_rnd_t)); + const mp_limb_t *, mpfr_prec_t, int, mpfr_prec_t, mpfr_rnd_t)); #define mpfr_round_raw2(xp, xn, neg, r, prec) \ mpfr_round_raw_2((xp),(xn)*GMP_NUMB_BITS,(neg),(prec),(r)) @@ -1694,11 +1694,11 @@ __MPFR_DECLSPEC void mpfr_mulhigh_n _MPFR_PROTO ((mp_ptr, mp_srcptr, __MPFR_DECLSPEC void mpfr_sqrhigh_n _MPFR_PROTO ((mp_ptr, mp_srcptr, mp_size_t)); __MPFR_DECLSPEC int mpfr_round_p _MPFR_PROTO ((mp_limb_t *, mp_size_t, - mp_exp_t, mp_prec_t)); + mp_exp_t, mpfr_prec_t)); __MPFR_DECLSPEC void mpfr_dump_mant _MPFR_PROTO ((const mp_limb_t *, - mp_prec_t, mp_prec_t, - mp_prec_t)); + mpfr_prec_t, mpfr_prec_t, + mpfr_prec_t)); __MPFR_DECLSPEC int mpfr_round_near_x _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_uexp_t, int, @@ -264,7 +264,7 @@ __MPFR_DECLSPEC void mpfr_init _MPFR_PROTO ((mpfr_ptr)); __MPFR_DECLSPEC void mpfr_clear _MPFR_PROTO ((mpfr_ptr)); __MPFR_DECLSPEC void - mpfr_inits2 _MPFR_PROTO ((mp_prec_t, mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR; + mpfr_inits2 _MPFR_PROTO ((mpfr_prec_t, mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR; __MPFR_DECLSPEC void mpfr_inits _MPFR_PROTO ((mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR; __MPFR_DECLSPEC void @@ -279,11 +279,11 @@ __MPFR_DECLSPEC mpfr_prec_t mpfr_min_prec _MPFR_PROTO ((mpfr_srcptr)); __MPFR_DECLSPEC mp_exp_t mpfr_get_exp _MPFR_PROTO ((mpfr_srcptr)); __MPFR_DECLSPEC int mpfr_set_exp _MPFR_PROTO ((mpfr_ptr, mp_exp_t)); -__MPFR_DECLSPEC mp_prec_t mpfr_get_prec _MPFR_PROTO((mpfr_srcptr)); +__MPFR_DECLSPEC mpfr_prec_t mpfr_get_prec _MPFR_PROTO((mpfr_srcptr)); __MPFR_DECLSPEC void mpfr_set_prec _MPFR_PROTO((mpfr_ptr, mpfr_prec_t)); __MPFR_DECLSPEC void mpfr_set_prec_raw _MPFR_PROTO((mpfr_ptr, mpfr_prec_t)); __MPFR_DECLSPEC void mpfr_set_default_prec _MPFR_PROTO((mpfr_prec_t)); -__MPFR_DECLSPEC mp_prec_t mpfr_get_default_prec _MPFR_PROTO((void)); +__MPFR_DECLSPEC mpfr_prec_t mpfr_get_default_prec _MPFR_PROTO((void)); __MPFR_DECLSPEC int mpfr_set_d _MPFR_PROTO ((mpfr_ptr, double, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_set_flt _MPFR_PROTO ((mpfr_ptr, float, mpfr_rnd_t)); @@ -691,13 +691,13 @@ __MPFR_DECLSPEC int mpfr_subnormalize _MPFR_PROTO ((mpfr_ptr, int, __MPFR_DECLSPEC int mpfr_strtofr _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, char **, int, mpfr_rnd_t)); -__MPFR_DECLSPEC size_t mpfr_custom_get_size _MPFR_PROTO ((mp_prec_t)); -__MPFR_DECLSPEC void mpfr_custom_init _MPFR_PROTO ((void *, mp_prec_t)); +__MPFR_DECLSPEC size_t mpfr_custom_get_size _MPFR_PROTO ((mpfr_prec_t)); +__MPFR_DECLSPEC void mpfr_custom_init _MPFR_PROTO ((void *, mpfr_prec_t)); __MPFR_DECLSPEC void * mpfr_custom_get_mantissa _MPFR_PROTO ((mpfr_srcptr)); __MPFR_DECLSPEC mp_exp_t mpfr_custom_get_exp _MPFR_PROTO ((mpfr_srcptr)); __MPFR_DECLSPEC void mpfr_custom_move _MPFR_PROTO ((mpfr_ptr, void *)); __MPFR_DECLSPEC void mpfr_custom_init_set _MPFR_PROTO ((mpfr_ptr, int, - mp_exp_t, mp_prec_t, void *)); + mp_exp_t, mpfr_prec_t, void *)); __MPFR_DECLSPEC int mpfr_custom_get_kind _MPFR_PROTO ((mpfr_srcptr)); #if defined (__cplusplus) @@ -557,11 +557,11 @@ the sign bit of a NaN is unspecified. @cindex Precision -@tindex @code{mp_prec_t} +@tindex @code{mpfr_prec_t} @noindent The @dfn{precision} is the number of bits used to represent the significand of a floating-point number; -the corresponding C data type is @code{mp_prec_t}. +the corresponding C data type is @code{mpfr_prec_t}. The precision can be any integer between @code{MPFR_PREC_MIN} and @code{MPFR_PREC_MAX}. In the current implementation, @code{MPFR_PREC_MIN} is equal to 2. @@ -897,7 +897,7 @@ An @code{mpfr_t} object must be initialized before storing the first value in it. The functions @code{mpfr_init} and @code{mpfr_init2} are used for that purpose. -@deftypefun void mpfr_init2 (mpfr_t @var{x}, mp_prec_t @var{prec}) +@deftypefun void mpfr_init2 (mpfr_t @var{x}, mpfr_prec_t @var{prec}) Initialize @var{x}, set its precision to be @strong{exactly} @var{prec} bits and its value to NaN. (Warning: the corresponding @code{mpf} functions initialize to zero instead.) @@ -910,7 +910,7 @@ The precision @var{prec} must be an integer between @code{MPFR_PREC_MIN} and @code{MPFR_PREC_MAX} (otherwise the behavior is undefined). @end deftypefun -@deftypefun void mpfr_inits2 (mp_prec_t @var{prec}, mpfr_t @var{x}, ...) +@deftypefun void mpfr_inits2 (mpfr_prec_t @var{prec}, mpfr_t @var{x}, ...) Initialize all the @code{mpfr_t} variables of the given @code{va_list}, set their precision to be @strong{exactly} @var{prec} bits and their value to NaN. @@ -997,7 +997,7 @@ due to the @code{MPFR_DECL_INIT} implementation. @end itemize @end defmac -@deftypefun void mpfr_set_default_prec (mp_prec_t @var{prec}) +@deftypefun void mpfr_set_default_prec (mpfr_prec_t @var{prec}) Set the default precision to be @strong{exactly} @var{prec} bits. The precision of a variable means the number of bits used to store its significand. All @@ -1008,7 +1008,7 @@ The precision can be any integer between @code{MPFR_PREC_MIN} and @code{MPFR_PREC_MAX}. @end deftypefun -@deftypefun mp_prec_t mpfr_get_default_prec (void) +@deftypefun mpfr_prec_t mpfr_get_default_prec (void) Return the default MPFR precision in bits. @end deftypefun @@ -1033,7 +1033,7 @@ calculation. A typical use would be for adjusting the precision gradually in iterative algorithms like Newton-Raphson, making the computation precision closely match the actual accurate part of the numbers. -@deftypefun void mpfr_set_prec (mpfr_t @var{x}, mp_prec_t @var{prec}) +@deftypefun void mpfr_set_prec (mpfr_t @var{x}, mpfr_prec_t @var{prec}) Reset the precision of @var{x} to be @strong{exactly} @var{prec} bits, and set its value to NaN. The previous value stored in @var{x} is lost. It is equivalent to @@ -1047,7 +1047,7 @@ In case you want to keep the previous value stored in @var{x}, use @code{mpfr_prec_round} instead. @end deftypefun -@deftypefun mp_prec_t mpfr_get_prec (mpfr_t @var{x}) +@deftypefun mpfr_prec_t mpfr_get_prec (mpfr_t @var{x}) Return the precision actually used for assignments of @var{x}, i.e.@: the number of bits used to store its significand. @end deftypefun @@ -2072,7 +2072,7 @@ and @samp{P}: @item @samp{N} @tab @code{mp_limb_t} array, integer conversions @item @samp{Z} @tab @code{mpz_t}, integer conversions -@item @samp{P} @tab @code{mp_prec_t}, integer conversions +@item @samp{P} @tab @code{mpfr_prec_t}, integer conversions @item @samp{R} @tab @code{mpfr_t}, float conversions @end multitable @end quotation @@ -2098,15 +2098,15 @@ With conversion specification not involving @samp{P} and @samp{R} types, @code{mpfr_printf} behaves exactly as @code{gmp_printf}. The @samp{P} type specifies that a following @samp{o}, @samp{u}, @samp{x}, or -@samp{X} conversion specifier applies to a @code{mp_prec_t} argument. -It is needed because the @code{mp_prec_t} type does not necessarily +@samp{X} conversion specifier applies to a @code{mpfr_prec_t} argument. +It is needed because the @code{mpfr_prec_t} type does not necessarily correspond to an @code{unsigned int} or any fixed standard type. The @samp{precision} field specifies the minimum number of digits to appear. The default @samp{precision} is 1. For example: @example mpfr_t x; -mp_prec_t p; +mpfr_prec_t p; mpfr_init (x); @dots{} p = mpfr_get_prec (x); @@ -2376,7 +2376,7 @@ The default rounding mode is to nearest initially. Get the default rounding mode. @end deftypefun -@deftypefun int mpfr_prec_round (mpfr_t @var{x}, mp_prec_t @var{prec}, mpfr_rnd_t @var{rnd}) +@deftypefun int mpfr_prec_round (mpfr_t @var{x}, mpfr_prec_t @var{prec}, mpfr_rnd_t @var{rnd}) Round @var{x} according to @var{rnd} with precision @var{prec}, which must be an integer between @code{MPFR_PREC_MIN} and @code{MPFR_PREC_MAX} (otherwise the behavior is undefined). @@ -2400,11 +2400,11 @@ already an approximation to @var{n} bits: @end example @end deftypefun -@deftypefun int mpfr_round_prec (mpfr_t @var{x}, mpfr_rnd_t @var{rnd}, mp_prec_t @var{prec}) +@deftypefun int mpfr_round_prec (mpfr_t @var{x}, mpfr_rnd_t @var{rnd}, mpfr_prec_t @var{prec}) [This function is obsolete. Please use @code{mpfr_prec_round} instead.] @end deftypefun -@deftypefun int mpfr_can_round (mpfr_t @var{b}, mp_exp_t @var{err}, mpfr_rnd_t @var{rnd1}, mpfr_rnd_t @var{rnd2}, mp_prec_t @var{prec}) +@deftypefun int mpfr_can_round (mpfr_t @var{b}, mp_exp_t @var{err}, mpfr_rnd_t @var{rnd1}, mpfr_rnd_t @var{rnd2}, mpfr_prec_t @var{prec}) Assuming @var{b} is an approximation of an unknown number @var{x} in the direction @var{rnd1} with error at most two to the power E(b)-@var{err} where E(b) is the exponent of @var{b}, return a non-zero @@ -2769,7 +2769,7 @@ to zero, whereas the corresponding MPFR functions initialize to NaN: this is useful to detect uninitialized values, but is slightly incompatible with @code{mpf}. -@deftypefun void mpfr_set_prec_raw (mpfr_t @var{x}, mp_prec_t @var{prec}) +@deftypefun void mpfr_set_prec_raw (mpfr_t @var{x}, mpfr_prec_t @var{prec}) Reset the precision of @var{x} to be @strong{exactly} @var{prec} bits. The only difference with @code{mpfr_set_prec} is that @var{prec} is assumed to be small enough so that the significand fits into the current allocated memory @@ -2835,18 +2835,18 @@ GMP Custom Allocation, allocates its memory on the application stack. Note 3: This interface is preliminary. -@deftypefun size_t mpfr_custom_get_size (mp_prec_t @var{prec}) +@deftypefun size_t mpfr_custom_get_size (mpfr_prec_t @var{prec}) Return the needed size in bytes to store the significand of a FP number of precision @var{prec}. @end deftypefun -@deftypefun void mpfr_custom_init (void *@var{significand}, mp_prec_t @var{prec}) +@deftypefun void mpfr_custom_init (void *@var{significand}, mpfr_prec_t @var{prec}) Initialize a significand of precision @var{prec}. @var{significand} must be an area of @code{mpfr_custom_get_size (prec)} bytes at least and be suitably aligned for an array of @code{mp_limb_t}. @end deftypefun -@deftypefun void mpfr_custom_init_set (mpfr_t @var{x}, int @var{kind}, mp_exp_t @var{exp}, mp_prec_t @var{prec}, void *@var{significand}) +@deftypefun void mpfr_custom_init_set (mpfr_t @var{x}, int @var{kind}, mp_exp_t @var{exp}, mpfr_prec_t @var{prec}, void *@var{significand}) Perform a dummy initialization of a @code{mpfr_t} and set it to: @itemize @item if @code{ABS(kind) == MPFR_NAN_KIND}, @var{x} is set to NaN; @@ -40,7 +40,7 @@ mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mp_exp_t ax; mp_limb_t *tmp; mp_limb_t b1; - mp_prec_t bq, cq; + mpfr_prec_t bq, cq; mp_size_t bn, cn, tn, k; MPFR_TMP_DECL(marker); @@ -209,7 +209,7 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mp_exp_t ax, ax2; mp_limb_t *tmp; mp_limb_t b1; - mp_prec_t bq, cq; + mpfr_prec_t bq, cq; mp_size_t bn, cn, tn, k; MPFR_TMP_DECL (marker); @@ -351,7 +351,7 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mp_limb_t *bp, *cp; mp_size_t n; - mp_prec_t p; + mpfr_prec_t p; /* Fist check if we can reduce the precision of b or c: exact values are a nightmare for the short product trick */ @@ -102,7 +102,7 @@ mpfr_mul_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode /* now yp[xn], ..., yp[0] is msb-normalized too, and has at most PREC(x) + (GMP_NUMB_BITS - cnt) non-zero bits */ - MPFR_RNDRAW (inexact, y, yp, (mp_prec_t) (xn + 1) * GMP_NUMB_BITS, + MPFR_RNDRAW (inexact, y, yp, (mpfr_prec_t) (xn + 1) * GMP_NUMB_BITS, rnd_mode, MPFR_SIGN (x), cnt -- ); MPFR_TMP_FREE (marker); @@ -90,7 +90,7 @@ mpfr_pow_is_exact (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, = ((a'*2^b')^c with c odd integer */ { mpfr_t tmp; - mp_prec_t p; + mpfr_prec_t p; MPFR_MPZ_SIZEINBASE2 (p, a); mpfr_init2 (tmp, p); /* prec = 1 should not be possible */ res = mpfr_set_z (tmp, a, MPFR_RNDN); @@ -112,7 +112,7 @@ static int is_odd (mpfr_srcptr y) { mp_exp_t expo; - mp_prec_t prec; + mpfr_prec_t prec; mp_size_t yn; mp_limb_t *yp; @@ -165,8 +165,8 @@ mpfr_pow_general (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, int check_exact_case = 0; int inexact; /* Declaration of the size variable */ - mp_prec_t Nz = MPFR_PREC(z); /* target precision */ - mp_prec_t Nt; /* working precision */ + mpfr_prec_t Nz = MPFR_PREC(z); /* target precision */ + mpfr_prec_t Nt; /* working precision */ mp_exp_t err; /* error */ MPFR_ZIV_DECL (ziv_loop); @@ -228,7 +228,7 @@ mpfr_pow_general (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, /* We need to test */ if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (t) || MPFR_UNDERFLOW (flags1))) { - mp_prec_t Ntmin; + mpfr_prec_t Ntmin; MPFR_BLOCK_DECL (flags2); MPFR_ASSERTN (!k_non_zero); @@ -139,8 +139,8 @@ mpfr_pow_si (mpfr_ptr y, mpfr_srcptr x, long int n, mpfr_rnd_t rnd) /* Declaration of the intermediary variable */ mpfr_t t; /* Declaration of the size variable */ - mp_prec_t Ny; /* target precision */ - mp_prec_t Nt; /* working precision */ + mpfr_prec_t Ny; /* target precision */ + mpfr_prec_t Nt; /* working precision */ mpfr_rnd_t rnd1; int size_n; int inexact; @@ -30,7 +30,7 @@ mpfr_pow_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mpfr_rnd_t rnd) { unsigned long m; mpfr_t res; - mp_prec_t prec, err; + mpfr_prec_t prec, err; int inexact; mpfr_rnd_t rnd1; MPFR_SAVE_EXPO_DECL (expo); @@ -32,7 +32,7 @@ static int mpfr_pow_pos_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t rnd, int cr) { mpfr_t res; - mp_prec_t prec, err; + mpfr_prec_t prec, err; int inexact; mpfr_rnd_t rnd1, rnd2; mpz_t absz; @@ -260,7 +260,7 @@ mpfr_pow_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t rnd) { /* Declaration of the intermediary variable */ mpfr_t t; - mp_prec_t Nt; /* Precision of the intermediary variable */ + mpfr_prec_t Nt; /* Precision of the intermediary variable */ mpfr_rnd_t rnd1; mp_size_t size_z; MPFR_ZIV_DECL (loop); diff --git a/print_raw.c b/print_raw.c index 968f2bc26..214583ad9 100644 --- a/print_raw.c +++ b/print_raw.c @@ -42,7 +42,7 @@ mpfr_fprint_binary (FILE *stream, mpfr_srcptr x) else { mp_limb_t *mx; - mp_prec_t px; + mpfr_prec_t px; mp_size_t n; mx = MPFR_MANT (x); @@ -79,10 +79,10 @@ mpfr_print_binary (mpfr_srcptr x) } void -mpfr_print_mant_binary(const char *str, const mp_limb_t *p, mp_prec_t r) +mpfr_print_mant_binary(const char *str, const mp_limb_t *p, mpfr_prec_t r) { int i; - mp_prec_t count = 0; + mpfr_prec_t count = 0; char c; mp_size_t n = (r - 1) / GMP_NUMB_BITS + 1; @@ -103,11 +103,11 @@ mpfr_print_mant_binary(const char *str, const mp_limb_t *p, mp_prec_t r) } void -mpfr_dump_mant (const mp_limb_t *p, mp_prec_t r, mp_prec_t precx, - mp_prec_t error) +mpfr_dump_mant (const mp_limb_t *p, mpfr_prec_t r, mpfr_prec_t precx, + mpfr_prec_t error) { int i; - mp_prec_t count = 0; + mpfr_prec_t count = 0; char c; mp_size_t n = (r - 1) / GMP_NUMB_BITS + 1; diff --git a/rec_sqrt.c b/rec_sqrt.c index 1a560d1c6..6033c4520 100644 --- a/rec_sqrt.c +++ b/rec_sqrt.c @@ -70,8 +70,8 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., http://www.loria.fr/~zimmerma/mca/pub226.html */ static void -mpfr_mpn_rec_sqrt (mp_ptr x, mp_prec_t p, - mp_srcptr a, mp_prec_t ap, int as) +mpfr_mpn_rec_sqrt (mp_ptr x, mpfr_prec_t p, + mp_srcptr a, mpfr_prec_t ap, int as) { /* the following T1 and T2 are bipartite tables giving initial @@ -191,7 +191,7 @@ mpfr_mpn_rec_sqrt (mp_ptr x, mp_prec_t p, } else /* p >= 12 */ { - mp_prec_t h, pl; + mpfr_prec_t h, pl; mp_ptr r, s, t, u; mp_size_t xn, rn, th, ln, tn, sn, ahn, un; mp_limb_t neg, cy, cu; @@ -418,7 +418,7 @@ mpfr_mpn_rec_sqrt (mp_ptr x, mp_prec_t p, int mpfr_rec_sqrt (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) { - mp_prec_t rp, up, wp; + mpfr_prec_t rp, up, wp; mp_size_t rn, wn; int s, cy, inex; mp_ptr x; @@ -511,7 +511,7 @@ mpfr_rec_sqrt (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) mantissa is exactly 1/2 and the exponent is odd. */ if (s == 0 && mpfr_cmp_ui_2exp (u, 1, MPFR_EXP(u) - 1) == 0) { - mp_prec_t pl = wn * GMP_NUMB_BITS - wp; + mpfr_prec_t pl = wn * GMP_NUMB_BITS - wp; /* we should have x=111...111 */ mpn_add_1 (x, x, wn, MPFR_LIMB_ONE << pl); @@ -43,7 +43,7 @@ mpfr_root (mpfr_ptr y, mpfr_srcptr x, unsigned long k, mpfr_rnd_t rnd_mode) { mpz_t m; mp_exp_t e, r, sh; - mp_prec_t n, size_m, tmp; + mpfr_prec_t n, size_m, tmp; int inexact, negative; MPFR_SAVE_EXPO_DECL (expo); @@ -25,9 +25,9 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* Check against mpfr_can_round ? */ #ifdef WANT_ASSERT # if WANT_ASSERT >= 2 -int mpfr_round_p_2 (mp_limb_t *, mp_size_t, mp_exp_t, mp_prec_t); +int mpfr_round_p_2 (mp_limb_t *, mp_size_t, mp_exp_t, mpfr_prec_t); int -mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mp_exp_t err0, mp_prec_t prec) +mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mp_exp_t err0, mpfr_prec_t prec) { int i1, i2; @@ -55,14 +55,14 @@ mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mp_exp_t err0, mp_prec_t prec) * precision prec. */ int -mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mp_exp_t err0, mp_prec_t prec) +mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mp_exp_t err0, mpfr_prec_t prec) { - mp_prec_t err; + mpfr_prec_t err; mp_size_t k, n; mp_limb_t tmp, mask; int s; - err = (mp_prec_t) bn * GMP_NUMB_BITS; + err = (mpfr_prec_t) bn * GMP_NUMB_BITS; if (MPFR_UNLIKELY (err0 <= 0 || (mpfr_uexp_t) err0 <= prec || prec >= err)) return 0; /* can't round */ err = MIN (err, (mpfr_uexp_t) err0); diff --git a/round_prec.c b/round_prec.c index 16db4a5eb..723213de8 100644 --- a/round_prec.c +++ b/round_prec.c @@ -46,11 +46,11 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "round_raw_generic.c" int -mpfr_prec_round (mpfr_ptr x, mp_prec_t prec, mpfr_rnd_t rnd_mode) +mpfr_prec_round (mpfr_ptr x, mpfr_prec_t prec, mpfr_rnd_t rnd_mode) { mp_limb_t *tmp, *xp; int carry, inexact; - mp_prec_t nw, ow; + mpfr_prec_t nw, ow; MPFR_TMP_DECL(marker); MPFR_ASSERTN(prec >= MPFR_PREC_MIN && prec <= MPFR_PREC_MAX); @@ -119,7 +119,7 @@ mpfr_prec_round (mpfr_ptr x, mp_prec_t prec, mpfr_rnd_t rnd_mode) int mpfr_can_round (mpfr_srcptr b, mp_exp_t err, mpfr_rnd_t rnd1, - mpfr_rnd_t rnd2, mp_prec_t prec) + mpfr_rnd_t rnd2, mpfr_prec_t prec) { if (MPFR_UNLIKELY(MPFR_IS_SINGULAR(b))) return 0; /* We cannot round if Zero, Nan or Inf */ @@ -130,9 +130,9 @@ mpfr_can_round (mpfr_srcptr b, mp_exp_t err, mpfr_rnd_t rnd1, int mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mp_exp_t err0, - mpfr_rnd_t rnd1, mpfr_rnd_t rnd2, mp_prec_t prec) + mpfr_rnd_t rnd1, mpfr_rnd_t rnd2, mpfr_prec_t prec) { - mp_prec_t err; + mpfr_prec_t err; mp_size_t k, k1, tn; int s, s1; mp_limb_t cc, cc2; @@ -141,7 +141,7 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mp_exp_t err0, if (MPFR_UNLIKELY(err0 < 0 || (mpfr_uexp_t) err0 <= prec)) return 0; /* can't round */ - else if (MPFR_UNLIKELY (prec > (mp_prec_t) bn * GMP_NUMB_BITS)) + else if (MPFR_UNLIKELY (prec > (mpfr_prec_t) bn * GMP_NUMB_BITS)) { /* then ulp(b) < precision < error */ return rnd2 == MPFR_RNDN && (mpfr_uexp_t) err0 - 2 >= prec; /* can round only in rounding to the nearest and err0 >= prec + 2 */ @@ -152,8 +152,8 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mp_exp_t err0, /* if the error is smaller than ulp(b), then anyway it will propagate up to ulp(b) */ - err = ((mpfr_uexp_t) err0 > (mp_prec_t) bn * GMP_NUMB_BITS) ? - (mp_prec_t) bn * GMP_NUMB_BITS : (mp_prec_t) err0; + err = ((mpfr_uexp_t) err0 > (mpfr_prec_t) bn * GMP_NUMB_BITS) ? + (mpfr_prec_t) bn * GMP_NUMB_BITS : (mpfr_prec_t) err0; /* warning: if k = m*GMP_NUMB_BITS, consider limb m-1 and not m */ k = (err - 1) / GMP_NUMB_BITS; @@ -168,7 +168,7 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mp_exp_t err0, /* don't need to consider the k1 most significant limbs */ k -= k1; bn -= k1; - prec -= (mp_prec_t) k1 * GMP_NUMB_BITS; + prec -= (mpfr_prec_t) k1 * GMP_NUMB_BITS; /* if when adding or subtracting (1 << s) in bp[bn-1-k], it does not change bp[bn-1] >> s1, then we can round */ diff --git a/round_raw_generic.c b/round_raw_generic.c index 8c9ffa4fb..61ec13eec 100644 --- a/round_raw_generic.c +++ b/round_raw_generic.c @@ -55,8 +55,8 @@ mpfr_round_raw_generic( #if flag == 0 mp_limb_t *yp, #endif - const mp_limb_t *xp, mp_prec_t xprec, - int neg, mp_prec_t yprec, mpfr_rnd_t rnd_mode + const mp_limb_t *xp, mpfr_prec_t xprec, + int neg, mpfr_prec_t yprec, mpfr_rnd_t rnd_mode #if use_inexp != 0 , int *inexp #endif diff --git a/set_dfl_prec.c b/set_dfl_prec.c index eb6a168a4..9913c7f34 100644 --- a/set_dfl_prec.c +++ b/set_dfl_prec.c @@ -23,18 +23,18 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" /* default is IEEE double precision, i.e. 53 bits */ -mp_prec_t MPFR_THREAD_ATTR __gmpfr_default_fp_bit_precision \ +mpfr_prec_t MPFR_THREAD_ATTR __gmpfr_default_fp_bit_precision \ = IEEE_DBL_MANT_DIG; void -mpfr_set_default_prec (mp_prec_t prec) +mpfr_set_default_prec (mpfr_prec_t prec) { MPFR_ASSERTN (prec >= MPFR_PREC_MIN && prec <= MPFR_PREC_MAX); __gmpfr_default_fp_bit_precision = prec; } #undef mpfr_get_default_prec -mp_prec_t +mpfr_prec_t mpfr_get_default_prec (void) { return __gmpfr_default_fp_bit_precision; diff --git a/set_prec.c b/set_prec.c index dcd3b0488..051658e1c 100644 --- a/set_prec.c +++ b/set_prec.c @@ -48,7 +48,7 @@ mpfr_set_prec (mpfr_ptr x, mpfr_prec_t p) } #undef mpfr_get_prec -mp_prec_t +mpfr_prec_t mpfr_get_prec (mpfr_srcptr x) { return MPFR_PREC(x); @@ -33,7 +33,7 @@ set_z (mpfr_ptr f, mpz_srcptr z, mp_size_t *zs) mp_limb_t *p; mp_size_t s; int c; - mp_prec_t pf; + mpfr_prec_t pf; MPFR_ASSERTD (mpz_sgn (z) != 0); diff --git a/set_z_exp.c b/set_z_exp.c index ea238c629..42dbf57f9 100644 --- a/set_z_exp.c +++ b/set_z_exp.c @@ -64,7 +64,7 @@ mpfr_set_z_2exp (mpfr_ptr f, mpz_srcptr z, mp_exp_t e, mpfr_rnd_t rnd_mode) and exp = zn * GMP_NUMB_BITS + e - k <= (zn + en) * GMP_NUMB_BITS - k + GMP_NUMB_BITS - 1 <= MPFR_EMAX_MAX + 2 * GMP_NUMB_BITS - 1 */ - exp = (mp_prec_t) zn * GMP_NUMB_BITS + e - k; + exp = (mpfr_prec_t) zn * GMP_NUMB_BITS + e - k; /* The exponent will be exp or exp + 1 (due to rounding) */ if (MPFR_UNLIKELY (exp > __gmpfr_emax)) return mpfr_overflow (f, rnd_mode, sign_z); @@ -33,7 +33,7 @@ mpfr_setmax (mpfr_ptr x, mp_exp_t e) MPFR_SET_EXP (x, e); xn = 1 + (MPFR_PREC(x) - 1) / GMP_NUMB_BITS; - sh = (mp_prec_t) xn * GMP_NUMB_BITS - MPFR_PREC(x); + sh = (mpfr_prec_t) xn * GMP_NUMB_BITS - MPFR_PREC(x); xp = MPFR_MANT(x); xp[0] = MP_LIMB_T_MAX << sh; for (i = 1; i < xn; i++) @@ -39,7 +39,7 @@ mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) mpfr_t c, xr; mpfr_srcptr xx; mp_exp_t expx, err; - mp_prec_t precy, m; + mpfr_prec_t precy, m; int inexact, sign, reduce; MPFR_ZIV_DECL (loop); MPFR_SAVE_EXPO_DECL (expo); @@ -31,7 +31,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int mpfr_sin_cos (mpfr_ptr y, mpfr_ptr z, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { - mp_prec_t prec, m; + mpfr_prec_t prec, m; int neg, reduce; mpfr_t c, xr; mpfr_srcptr xx; @@ -232,10 +232,10 @@ mpfr_sin_cos (mpfr_ptr y, mpfr_ptr z, mpfr_srcptr x, mpfr_rnd_t rnd_mode) /* truncate Q from R to at most prec bits. Return the number of truncated bits. */ -static mp_prec_t -reduce (mpz_t Q, mpz_srcptr R, mp_prec_t prec) +static mpfr_prec_t +reduce (mpz_t Q, mpz_srcptr R, mpfr_prec_t prec) { - mp_prec_t l = mpz_sizeinbase (R, 2); + mpfr_prec_t l = mpz_sizeinbase (R, 2); l = (l > prec) ? l - prec : 0; mpz_fdiv_q_2exp (Q, R, l); @@ -246,7 +246,7 @@ reduce (mpz_t Q, mpz_srcptr R, mp_prec_t prec) Return the number of truncated bits. */ static unsigned long -reduce2 (mpz_t S, mpz_t C, mp_prec_t prec) +reduce2 (mpz_t S, mpz_t C, mpfr_prec_t prec) { unsigned long ls = mpz_sizeinbase (S, 2); unsigned long lc = mpz_sizeinbase (C, 2); @@ -280,15 +280,15 @@ reduce2 (mpz_t S, mpz_t C, mp_prec_t prec) Assumes prec >= 10. */ static unsigned long -sin_bs_aux (mpz_t Q0, mpz_t S0, mpz_t C0, mpz_srcptr p, mp_prec_t r, - mp_prec_t prec) +sin_bs_aux (mpz_t Q0, mpz_t S0, mpz_t C0, mpz_srcptr p, mpfr_prec_t r, + mpfr_prec_t prec) { mpz_t T[GMP_NUMB_BITS], Q[GMP_NUMB_BITS], ptoj[GMP_NUMB_BITS], pp; - mp_prec_t log2_nb_terms[GMP_NUMB_BITS], mult[GMP_NUMB_BITS]; - mp_prec_t accu[GMP_NUMB_BITS], size_ptoj[GMP_NUMB_BITS]; - mp_prec_t prec_i_have, r0 = r; + mpfr_prec_t log2_nb_terms[GMP_NUMB_BITS], mult[GMP_NUMB_BITS]; + mpfr_prec_t accu[GMP_NUMB_BITS], size_ptoj[GMP_NUMB_BITS]; + mpfr_prec_t prec_i_have, r0 = r; unsigned long alloc, i, j, k; - mp_prec_t l; + mpfr_prec_t l; if (MPFR_UNLIKELY(mpz_cmp_ui (p, 0) == 0)) /* sin(x)/x -> 1 */ { @@ -452,7 +452,7 @@ sin_bs_aux (mpz_t Q0, mpz_t S0, mpz_t C0, mpz_srcptr p, mp_prec_t r, static int sincos_aux (mpfr_t s, mpfr_t c, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { - mp_prec_t prec_s, sh; + mpfr_prec_t prec_s, sh; mpz_t Q, S, C, Q2, S2, C2, y; mpfr_t x2; unsigned long l, l2, j, err; @@ -568,7 +568,7 @@ mpfr_sincos_fast (mpfr_t s, mpfr_t c, mpfr_srcptr x, mpfr_rnd_t rnd) { int inexs, inexc; mpfr_t x_red, ts, tc; - mp_prec_t w; + mpfr_prec_t w; mp_exp_t err, errs, errc; MPFR_ZIV_DECL (loop); @@ -66,7 +66,7 @@ mpfr_sinh (mpfr_ptr y, mpfr_srcptr xt, mpfr_rnd_t rnd_mode) { mpfr_t t, ti; mp_exp_t d; - mp_prec_t Nt; /* Precision of the intermediary variable */ + mpfr_prec_t Nt; /* Precision of the intermediary variable */ long int err; /* Precision of error */ MPFR_ZIV_DECL (loop); MPFR_SAVE_EXPO_DECL (expo); diff --git a/sinh_cosh.c b/sinh_cosh.c index cc2983061..31ba2c891 100644 --- a/sinh_cosh.c +++ b/sinh_cosh.c @@ -77,7 +77,7 @@ mpfr_sinh_cosh (mpfr_ptr sh, mpfr_ptr ch, mpfr_srcptr xt, mpfr_rnd_t rnd_mode) { mpfr_t s, c, ti; mp_exp_t d; - mp_prec_t N; /* Precision of the intermediary variables */ + mpfr_prec_t N; /* Precision of the intermediary variables */ long int err; /* Precision of error */ MPFR_ZIV_DECL (loop); MPFR_SAVE_EXPO_DECL (expo); @@ -122,7 +122,7 @@ int verbose; We can't use GNU MPFR library since the THRESHOLD can't vary */ /* Setup mpfr_mul */ -mp_prec_t mpfr_mul_threshold = MPFR_MUL_THRESHOLD; +mpfr_prec_t mpfr_mul_threshold = MPFR_MUL_THRESHOLD; static double speed_mpfr_mul (struct speed_params *s) { SPEED_MPFR_OP (mpfr_mul); } @@ -134,9 +134,9 @@ static double speed_mpfr_mul (struct speed_params *s) { ************************************************/ #define THRESHOLD_WINDOW 16 #define THRESHOLD_FINAL_WINDOW 128 -static double domeasure (mp_prec_t *threshold, +static double domeasure (mpfr_prec_t *threshold, double (*func) (struct speed_params *), - mp_prec_t p) + mpfr_prec_t p) { struct speed_params s; mp_size_t size; @@ -171,12 +171,12 @@ static double domeasure (mp_prec_t *threshold, if algo2 is better for low prec, and algo1 better for high prec, the behaviour of this function is undefined. */ static void -tune_simple_func (mp_prec_t *threshold, +tune_simple_func (mpfr_prec_t *threshold, double (*func) (struct speed_params *), - mp_prec_t pstart, mp_prec_t pend) + mpfr_prec_t pstart, mpfr_prec_t pend) { double measure; - mp_prec_t p = pstart; + mpfr_prec_t p = pstart; mp_size_t k, n; while (p <= pend) @@ -29,7 +29,7 @@ mpfr_sqr (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) mp_exp_t ax; mp_limb_t *tmp; mp_limb_t b1; - mp_prec_t bq; + mpfr_prec_t bq; mp_size_t bn, tn; MPFR_TMP_DECL(marker); diff --git a/stack_interface.c b/stack_interface.c index 92bd2e012..1fcf65df3 100644 --- a/stack_interface.c +++ b/stack_interface.c @@ -24,14 +24,14 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #undef mpfr_custom_get_size size_t -mpfr_custom_get_size (mp_prec_t prec) +mpfr_custom_get_size (mpfr_prec_t prec) { return (prec + GMP_NUMB_BITS -1) / GMP_NUMB_BITS * BYTES_PER_MP_LIMB; } #undef mpfr_custom_init void -mpfr_custom_init (void *mantissa, mp_prec_t prec) +mpfr_custom_init (void *mantissa, mpfr_prec_t prec) { return ; } @@ -60,7 +60,7 @@ mpfr_custom_move (mpfr_ptr x, void *new_position) #undef mpfr_custom_init_set void mpfr_custom_init_set (mpfr_ptr x, int kind, mp_exp_t exp, - mp_prec_t prec, void *mantissa) + mpfr_prec_t prec, void *mantissa) { mpfr_kind_t t; int s; @@ -438,7 +438,7 @@ parse_string (mpfr_t x, struct parsed_string *pstr, static int parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd) { - mp_prec_t prec; + mpfr_prec_t prec; mp_exp_t exp; mp_exp_t ysize_bits; mp_limb_t *y, *result; @@ -33,7 +33,7 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int sign; mpfr_uexp_t diff_exp; - mp_prec_t cancel, cancel1; + mpfr_prec_t cancel, cancel1; mp_size_t cancel2, an, bn, cn, cn0; mp_limb_t *ap, *bp, *cp; mp_limb_t carry, bb, cc, borrow = 0; @@ -298,7 +298,7 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) #endif /* now perform rounding */ - sh = (mp_prec_t) an * GMP_NUMB_BITS - MPFR_PREC(a); + sh = (mpfr_prec_t) an * GMP_NUMB_BITS - MPFR_PREC(a); /* last unused bits from a */ carry = ap[0] & MPFR_LIMB_MASK (sh); ap[0] -= carry; @@ -136,7 +136,7 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mp_exp_t bx,cx; mpfr_uexp_t d; - mp_prec_t p, sh, cnt; + mpfr_prec_t p, sh, cnt; mp_size_t n; mp_limb_t *ap, *bp, *cp; mp_limb_t limb; @@ -604,9 +604,9 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) compute Cp+1 and C'p+2 from mantissa C */ mp_limb_t *tp = MPFR_MANT(c); /* Start from bit x=(p+1)-d in mantissa C */ - mp_prec_t x = p+1-d; + mpfr_prec_t x = p+1-d; mp_size_t kx = n-1 - (x/GMP_NUMB_BITS); - mp_prec_t sx = GMP_NUMB_BITS-1-(x%GMP_NUMB_BITS); + mpfr_prec_t sx = GMP_NUMB_BITS-1-(x%GMP_NUMB_BITS); MPFR_ASSERTD(p > d); DEBUG (printf ("(pre) x=%lu Kx=%ld Sx=%lu\n", (unsigned long) x, (long) kx, diff --git a/subnormal.c b/subnormal.c index b3cef3ca7..d36fa426b 100644 --- a/subnormal.c +++ b/subnormal.c @@ -105,7 +105,7 @@ mpfr_subnormalize (mpfr_ptr y, int old_inexact, mpfr_rnd_t rnd) else /* Hard case: It is more or less the same problem than mpfr_cache */ { mpfr_t dest; - mp_prec_t q; + mpfr_prec_t q; int sign; /* Compute the intermediary precision */ @@ -216,7 +216,7 @@ heap_sort (mpfr_srcptr *const tab, unsigned long n, mpfr_srcptr *perm) * Internal use function. */ static int -sum_once (mpfr_ptr ret, mpfr_srcptr *const tab, unsigned long n, mp_prec_t F) +sum_once (mpfr_ptr ret, mpfr_srcptr *const tab, unsigned long n, mpfr_prec_t F) { mpfr_t sum; unsigned long i; @@ -243,7 +243,7 @@ int mpfr_sum (mpfr_ptr ret, mpfr_ptr *const tab_p, unsigned long n, mpfr_rnd_t rnd) { mpfr_t cur_sum; - mp_prec_t prec; + mpfr_prec_t prec; mpfr_srcptr *perm, *const tab = (mpfr_srcptr *) tab_p; int k, error_trap; MPFR_ZIV_DECL (loop); @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int mpfr_tan (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { - mp_prec_t precy, m; + mpfr_prec_t precy, m; int inexact; mpfr_t s, c; MPFR_ZIV_DECL (loop); @@ -71,8 +71,8 @@ mpfr_tanh (mpfr_ptr y, mpfr_srcptr xt , mpfr_rnd_t rnd_mode) mp_exp_t d; /* Declaration of the size variable */ - mp_prec_t Ny = MPFR_PREC(y); /* target precision */ - mp_prec_t Nt; /* working precision */ + mpfr_prec_t Ny = MPFR_PREC(y); /* target precision */ + mpfr_prec_t Nt; /* working precision */ long int err; /* error */ int sign = MPFR_SIGN (xt); MPFR_ZIV_DECL (loop); diff --git a/tests/mpfr-test.h b/tests/mpfr-test.h index b8df10e30..3c88ced10 100644 --- a/tests/mpfr-test.h +++ b/tests/mpfr-test.h @@ -87,7 +87,7 @@ void tests_default_random _MPFR_PROTO ((mpfr_ptr, int, mp_exp_t, mp_exp_t)); void data_check _MPFR_PROTO ((char *, int (*) (FLIST), char *)); void bad_cases _MPFR_PROTO ((int (*)(FLIST), int (*)(FLIST), char *, int, mp_exp_t, mp_exp_t, - mp_prec_t, mp_prec_t, mp_prec_t, int)); + mpfr_prec_t, mpfr_prec_t, mpfr_prec_t, int)); int mpfr_cmp_str _MPFR_PROTO ((mpfr_srcptr x, const char *, int, mpfr_rnd_t)); #define mpfr_cmp_str1(x,s) mpfr_cmp_str(x,s,10,MPFR_RNDN) @@ -132,7 +132,7 @@ mpfr_print_raw (mpfr_srcptr x) else { mp_limb_t *mx; - mp_prec_t px; + mpfr_prec_t px; mp_size_t n; mx = MPFR_MANT (x); diff --git a/tests/reuse.c b/tests/reuse.c index bfc360ab3..05fb9c8fd 100644 --- a/tests/reuse.c +++ b/tests/reuse.c @@ -89,7 +89,7 @@ mpfr_compare (mpfr_srcptr a, mpfr_srcptr b) static void test3 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t), - char *foo, mp_prec_t prec, mpfr_rnd_t rnd) + char *foo, mpfr_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref2, ref3; mpfr_t res1; @@ -160,7 +160,7 @@ test3 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t), static void test4 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t), - char *foo, mp_prec_t prec, mpfr_rnd_t rnd) + char *foo, mpfr_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref, op1, op2, op3; mpfr_t res; @@ -288,7 +288,7 @@ test4 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, static void test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mpfr_rnd_t), - char *foo, mp_prec_t prec, mpfr_rnd_t rnd) + char *foo, mpfr_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref2; unsigned int ref3; @@ -333,7 +333,7 @@ test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mpfr_rnd_t), static void testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mpfr_rnd_t), - char *foo, mp_prec_t prec, mpfr_rnd_t rnd) + char *foo, mpfr_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref3; unsigned int ref2; @@ -374,7 +374,7 @@ testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mpfr_rnd_t), /* foo(mpfr_ptr, mpfr_srcptr, mp_rndt) */ static void test2 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_rnd_t), - char *foo, mp_prec_t prec, mpfr_rnd_t rnd) + char *foo, mpfr_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref2; mpfr_t res1; @@ -414,7 +414,7 @@ test2 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_rnd_t), /* foo(mpfr_ptr, mpfr_srcptr) */ static void test2a (int (*testfunc)(mpfr_ptr, mpfr_srcptr), - char *foo, mp_prec_t prec) + char *foo, mpfr_prec_t prec) { mpfr_t ref1, ref2; mpfr_t res1; @@ -454,7 +454,7 @@ test2a (int (*testfunc)(mpfr_ptr, mpfr_srcptr), /* one operand, two results */ static void test3a (int (*testfunc)(mpfr_ptr, mpfr_ptr, mpfr_srcptr, mpfr_rnd_t), - char *foo, mp_prec_t prec, mpfr_rnd_t rnd) + char *foo, mpfr_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref2, ref3; mpfr_t res1, res2; @@ -520,7 +520,7 @@ int main (void) { int rnd; - mp_prec_t p; + mpfr_prec_t p; tests_start_mpfr (); p = (randlimb () % 200)+ MPFR_PREC_MIN; diff --git a/tests/tabs.c b/tests/tabs.c index b107f3449..345ff9586 100644 --- a/tests/tabs.c +++ b/tests/tabs.c @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static void check_inexact (void) { - mp_prec_t p, q; + mpfr_prec_t p, q; mpfr_t x, y, absx; int rnd; int inexact, cmp; diff --git a/tests/tadd.c b/tests/tadd.c index 5779e6ef6..983dacf70 100644 --- a/tests/tadd.c +++ b/tests/tadd.c @@ -467,7 +467,7 @@ static void check_inexact (void) { mpfr_t x, y, z, u; - mp_prec_t px, py, pu, pz; + mpfr_prec_t px, py, pu, pz; int inexact, cmp; mpfr_rnd_t rnd; @@ -627,7 +627,7 @@ static void check_overflow (void) { mpfr_t a, b, c; - mp_prec_t prec_a; + mpfr_prec_t prec_a; int r; mpfr_init2 (a, 256); @@ -676,7 +676,7 @@ check_1111 (void) mpfr_set_ui (one, 1, MPFR_RNDN); for (n = 0; n < NUM; n++) { - mp_prec_t prec_a, prec_b, prec_c; + mpfr_prec_t prec_a, prec_b, prec_c; mp_exp_t tb=0, tc, diff; mpfr_t a, b, c, s; int m = 512; @@ -747,7 +747,7 @@ check_1111 (void) static void check_1minuseps (void) { - static mp_prec_t prec_a[] = { + static mpfr_prec_t prec_a[] = { MPFR_PREC_MIN, 30, 31, 32, 33, 62, 63, 64, 65, 126, 127, 128, 129 }; static int supp_b[] = { @@ -761,7 +761,7 @@ check_1minuseps (void) for (ia = 0; ia < numberof (prec_a); ia++) for (ib = 0; ib < numberof(supp_b); ib++) { - mp_prec_t prec_b; + mpfr_prec_t prec_b; int rnd_mode; prec_b = prec_a[ia] + supp_b[ib]; diff --git a/tests/tadd1sp.c b/tests/tadd1sp.c index d11b2baa6..ba545e597 100644 --- a/tests/tadd1sp.c +++ b/tests/tadd1sp.c @@ -105,7 +105,7 @@ main (void) } static void -check_random (mp_prec_t p) +check_random (mpfr_prec_t p) { mpfr_t a1,b,c,a2; int r; diff --git a/tests/taway.c b/tests/taway.c index d900f9e0f..34c6a7c57 100644 --- a/tests/taway.c +++ b/tests/taway.c @@ -94,7 +94,7 @@ test3 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t), { mpfr_t ref1, ref2, ref3; mpfr_t res1; - mp_prec_t p1, p2, p3; + mpfr_prec_t p1, p2, p3; int i, inexa, inexd; mpfr_rnd_t r; @@ -140,7 +140,7 @@ test4 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t), char *foo) { mpfr_t ref, op1, op2, op3; - mp_prec_t pout, p1, p2, p3; + mpfr_prec_t pout, p1, p2, p3; mpfr_t res; int i, j, k, inexa, inexd; mpfr_rnd_t r; @@ -199,7 +199,7 @@ test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mpfr_rnd_t), mpfr_t ref1, ref2; unsigned int ref3; mpfr_t res1; - mp_prec_t p1, p2; + mpfr_prec_t p1, p2; int i, inexa, inexd; mpfr_rnd_t r; @@ -244,7 +244,7 @@ testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mpfr_rnd_t), mpfr_t ref1, ref3; unsigned int ref2; mpfr_t res1; - mp_prec_t p1, p3; + mpfr_prec_t p1, p3; int i, inexa, inexd; mpfr_rnd_t r; @@ -285,7 +285,7 @@ test2 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_rnd_t), char *foo) { mpfr_t ref1, ref2; mpfr_t res1; - mp_prec_t p1, p2; + mpfr_prec_t p1, p2; int i, inexa, inexd; mpfr_rnd_t r; @@ -326,7 +326,7 @@ test3a (int (*testfunc)(mpfr_ptr, mpfr_ptr, mpfr_srcptr, mpfr_rnd_t), char *foo) { mpfr_t ref1, ref2, ref3; mpfr_t res1, res2; - mp_prec_t p1, p2, p3; + mpfr_prec_t p1, p2, p3; int i, inexa, inexd; mpfr_rnd_t r; diff --git a/tests/tcan_round.c b/tests/tcan_round.c index dd5caac5b..4809a120c 100644 --- a/tests/tcan_round.c +++ b/tests/tcan_round.c @@ -32,7 +32,7 @@ check_round_p (void) { mp_limb_t buf[MAX_LIMB_SIZE]; mp_size_t n, i; - mp_prec_t p; + mpfr_prec_t p; mp_exp_t err; int r1, r2; @@ -41,7 +41,7 @@ check_round_p (void) /* avoid mpn_random which leaks memory */ for (i = 0; i < n; i++) buf[i] = randlimb (); - p = (mp_prec_t) randlimb() % ((n-1) * GMP_NUMB_BITS) + MPFR_PREC_MIN; + p = (mpfr_prec_t) randlimb() % ((n-1) * GMP_NUMB_BITS) + MPFR_PREC_MIN; err = p + randlimb () % GMP_NUMB_BITS; r1 = mpfr_round_p (buf, n, err, p); r2 = mpfr_can_round_raw (buf, n, MPFR_SIGN_POS, err, @@ -61,7 +61,7 @@ int main (void) { mpfr_t x; - mp_prec_t i, j; + mpfr_prec_t i, j; tests_start_mpfr (); diff --git a/tests/tcbrt.c b/tests/tcbrt.c index 359b9d785..13fed4507 100644 --- a/tests/tcbrt.c +++ b/tests/tcbrt.c @@ -153,7 +153,7 @@ main (void) { mpfr_t x; int r; - mp_prec_t p; + mpfr_prec_t p; tests_start_mpfr (); diff --git a/tests/tcmp.c b/tests/tcmp.c index 435842316..5f5b2e73d 100644 --- a/tests/tcmp.c +++ b/tests/tcmp.c @@ -32,7 +32,7 @@ main (void) mpfr_t xx, yy; int c; long i; - mp_prec_t p; + mpfr_prec_t p; tests_start_mpfr (); diff --git a/tests/tcmp2.c b/tests/tcmp2.c index e99706c57..05a2e9491 100644 --- a/tests/tcmp2.c +++ b/tests/tcmp2.c @@ -51,7 +51,7 @@ worst_cases (void) { mpfr_t x, y; unsigned int i, j, k, b, expected; - mp_prec_t l; + mpfr_prec_t l; mpfr_init2 (x, 200); mpfr_init2 (y, 200); @@ -142,7 +142,7 @@ static void tcmp2 (double x, double y, int i) { mpfr_t xx, yy; - mp_prec_t j; + mpfr_prec_t j; if (i == -1) { @@ -183,7 +183,7 @@ static void special (void) { mpfr_t x, y; - mp_prec_t j; + mpfr_prec_t j; mpfr_init (x); mpfr_init (y); diff --git a/tests/tcomparisons.c b/tests/tcomparisons.c index 8eed7bf6a..adccfe7e8 100644 --- a/tests/tcomparisons.c +++ b/tests/tcomparisons.c @@ -36,7 +36,7 @@ cmp_tests (void) mpfr_inits (x, y, (mpfr_ptr) 0); for (i = 0; i < 80000; i++) { - mp_prec_t precx, precy; + mpfr_prec_t precx, precy; int signx, signy, cmp; unsigned int cmpbool = 0; @@ -97,7 +97,7 @@ eq_tests (void) mpfr_inits (x, y, (mpfr_ptr) 0); for (i = 0; i < 20000; i++) { - mp_prec_t precx; + mpfr_prec_t precx; precx = (randlimb () % 17) * 11 + MPFR_PREC_MIN; mpfr_set_prec (x, precx); diff --git a/tests/tconst_log2.c b/tests/tconst_log2.c index 140c78d4c..d0acb89e5 100644 --- a/tests/tconst_log2.c +++ b/tests/tconst_log2.c @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* tlog2 [prec] [rnd] [0 = no print] */ static void -check (mp_prec_t p0, mp_prec_t p1) +check (mpfr_prec_t p0, mpfr_prec_t p1) { mpfr_t x, y, z; mpfr_rnd_t rnd; diff --git a/tests/tconst_pi.c b/tests/tconst_pi.c index 24a244097..6a2322f56 100644 --- a/tests/tconst_pi.c +++ b/tests/tconst_pi.c @@ -76,7 +76,7 @@ bug20091030 (void) { mpfr_t x, x_ref; int inex, inex_ref; - mp_prec_t p; + mpfr_prec_t p; int r; mpfr_free_cache (); @@ -129,7 +129,7 @@ int main (int argc, char *argv[]) { mpfr_t x; - mp_prec_t p; + mpfr_prec_t p; mpfr_rnd_t rnd; tests_start_mpfr (); diff --git a/tests/tdiv.c b/tests/tdiv.c index d1d534579..4fbe3bed1 100644 --- a/tests/tdiv.c +++ b/tests/tdiv.c @@ -288,7 +288,7 @@ static void check_hard (void) { mpfr_t u, v, q, q2; - mp_prec_t precu, precv, precq; + mpfr_prec_t precu, precv, precq; int rnd; int inex, inex2, i, j; @@ -515,7 +515,7 @@ static void check_inexact (void) { mpfr_t x, y, z, u; - mp_prec_t px, py, pu; + mpfr_prec_t px, py, pu; int inexact, cmp; mpfr_rnd_t rnd; @@ -768,7 +768,7 @@ consistency (void) for (i = 0; i < 10000; i++) { mpfr_rnd_t rnd; - mp_prec_t px, py, pz, p; + mpfr_prec_t px, py, pz, p; int inex1, inex2; rnd = RND_RAND (); diff --git a/tests/tdiv_ui.c b/tests/tdiv_ui.c index ee976d1b2..e78e4b623 100644 --- a/tests/tdiv_ui.c +++ b/tests/tdiv_ui.c @@ -144,7 +144,7 @@ static void check_inexact (void) { mpfr_t x, y, z; - mp_prec_t px, py; + mpfr_prec_t px, py; int inexact, cmp; unsigned long int u; int rnd; diff --git a/tests/teint.c b/tests/teint.c index e31be56e0..2869c5cce 100644 --- a/tests/teint.c +++ b/tests/teint.c @@ -192,7 +192,7 @@ main (int argc, char *argv[]) if (argc != 1) /* teint x [prec] */ { mpfr_t x; - mp_prec_t p; + mpfr_prec_t p; p = (argc < 3) ? 53 : atoi (argv[2]); mpfr_init2 (x, p); mpfr_set_str (x, argv[1], 10, MPFR_RNDN); diff --git a/tests/tests.c b/tests/tests.c index 2f6856b67..7143777a5 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -539,7 +539,7 @@ static void test5rm (int (*fct) (FLIST), mpfr_srcptr x, mpfr_ptr y, mpfr_ptr z, mpfr_rnd_t rnd, int test_one, char *name) { - mp_prec_t yprec = MPFR_PREC (y); + mpfr_prec_t yprec = MPFR_PREC (y); mpfr_rnd_t rndnext = MPFR_RND_MAX; /* means uninitialized */ MPFR_ASSERTN (test_one || rnd == MPFR_RNDZ); @@ -637,7 +637,7 @@ void data_check (char *f, int (*foo) (FLIST), char *name) { FILE *fp; - mp_prec_t xprec, yprec; + mpfr_prec_t xprec, yprec; mpfr_t x, y, z; mpfr_rnd_t rnd; char r; @@ -792,7 +792,7 @@ data_check (char *f, int (*foo) (FLIST), char *name) void bad_cases (int (*fct)(FLIST), int (*inv)(FLIST), char *name, int pos, mp_exp_t emin, mp_exp_t emax, - mp_prec_t pymin, mp_prec_t pymax, mp_prec_t psup, + mpfr_prec_t pymin, mpfr_prec_t pymax, mpfr_prec_t psup, int n) { mpfr_t x, y, z; @@ -808,7 +808,7 @@ bad_cases (int (*fct)(FLIST), int (*inv)(FLIST), char *name, mpfr_inits (x, y, z, (mpfr_ptr) 0); for (i = 0; i < n; i++) { - mp_prec_t px, py, pz; + mpfr_prec_t px, py, pz; int inex; if (dbg) diff --git a/tests/texp.c b/tests/texp.c index f3187b04e..dc75cad65 100644 --- a/tests/texp.c +++ b/tests/texp.c @@ -156,10 +156,10 @@ check_worst_cases (void) } static void -compare_exp2_exp3 (mp_prec_t p0, mp_prec_t p1) +compare_exp2_exp3 (mpfr_prec_t p0, mpfr_prec_t p1) { mpfr_t x, y, z; - mp_prec_t prec; + mpfr_prec_t prec; mpfr_rnd_t rnd; mpfr_init (x); @@ -199,7 +199,7 @@ static void check_large (void) { mpfr_t x, z; - mp_prec_t prec; + mpfr_prec_t prec; /* bug found by Patrick Pe'lissier on 7 Jun 2004 */ prec = 203780; @@ -596,7 +596,7 @@ bug20080731 (void) { mp_exp_t emin; mpfr_t x, y1, y2; - mp_prec_t prec = 64; + mpfr_prec_t prec = 64; emin = mpfr_get_emin (); set_emin (MPFR_EMIN_MIN); diff --git a/tests/tfactorial.c b/tests/tfactorial.c index ef507b140..6763f95d3 100644 --- a/tests/tfactorial.c +++ b/tests/tfactorial.c @@ -74,7 +74,7 @@ test_int (void) unsigned long n0 = 1, n1 = 80, n; mpz_t f; mpfr_t x, y; - mp_prec_t prec_f, p; + mpfr_prec_t prec_f, p; int r; int inex1, inex2; diff --git a/tests/tfma.c b/tests/tfma.c index 01e872664..a1d95fa1d 100644 --- a/tests/tfma.c +++ b/tests/tfma.c @@ -539,13 +539,13 @@ main (int argc, char *argv[]) } { - mp_prec_t prec; + mpfr_prec_t prec; mpfr_t t, slong; mpfr_rnd_t rnd; int inexact, compare; unsigned int n; - mp_prec_t p0=2, p1=200; + mpfr_prec_t p0=2, p1=200; unsigned int N=200; mpfr_init (t); diff --git a/tests/tfms.c b/tests/tfms.c index a9ef94141..888432a7c 100644 --- a/tests/tfms.c +++ b/tests/tfms.c @@ -542,13 +542,13 @@ main (int argc, char *argv[]) } { - mp_prec_t prec; + mpfr_prec_t prec; mpfr_t t, slong; mpfr_rnd_t rnd; int inexact, compare; unsigned int n; - mp_prec_t p0=2, p1=200; + mpfr_prec_t p0=2, p1=200; unsigned int N=200; mpfr_init (t); diff --git a/tests/tfrac.c b/tests/tfrac.c index 259f95ca5..fabe5c7c9 100644 --- a/tests/tfrac.c +++ b/tests/tfrac.c @@ -30,7 +30,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define PMAX (PIP+2*PFP) static void -check0 (mpfr_ptr ip, mpfr_ptr fp, mp_prec_t prec, mpfr_rnd_t rnd) +check0 (mpfr_ptr ip, mpfr_ptr fp, mpfr_prec_t prec, mpfr_rnd_t rnd) { mpfr_t sum, tmp, dst, fp2; int inex1, inex2; diff --git a/tests/tgeneric.c b/tests/tgeneric.c index 3b374a41a..2f9804b62 100644 --- a/tests/tgeneric.c +++ b/tests/tgeneric.c @@ -108,9 +108,9 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #endif static void -test_generic (mp_prec_t p0, mp_prec_t p1, unsigned int N) +test_generic (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int N) { - mp_prec_t prec, xprec, yprec; + mpfr_prec_t prec, xprec, yprec; mpfr_t x, y, z, t; #ifdef TWO_ARGS mpfr_t u; diff --git a/tests/tgeneric_ui.c b/tests/tgeneric_ui.c index e2b405dd0..cccbf55af 100644 --- a/tests/tgeneric_ui.c +++ b/tests/tgeneric_ui.c @@ -32,9 +32,9 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #endif static void -test_generic_ui (mp_prec_t p0, mp_prec_t p1, unsigned int N) +test_generic_ui (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int N) { - mp_prec_t prec, yprec; + mpfr_prec_t prec, yprec; mpfr_t x, y, z, t; INTEGER_TYPE u; mpfr_rnd_t rnd; diff --git a/tests/tget_sj.c b/tests/tget_sj.c index fbefc2b49..2a0cff20e 100644 --- a/tests/tget_sj.c +++ b/tests/tget_sj.c @@ -211,7 +211,7 @@ check_erange (void) int main (void) { - mp_prec_t prec; + mpfr_prec_t prec; mpfr_t x, y; intmax_t s; uintmax_t u; diff --git a/tests/tget_str.c b/tests/tget_str.c index 3b2913bec..76072a807 100644 --- a/tests/tget_str.c +++ b/tests/tget_str.c @@ -50,7 +50,7 @@ check_small (void) mpfr_t x; char *s; mp_exp_t e; - mp_prec_t p; + mpfr_prec_t p; mpfr_init (x); @@ -1072,7 +1072,7 @@ check_large (void) #define MAX_DIGITS 100 static void -check_special (int b, mp_prec_t p) +check_special (int b, mpfr_prec_t p) { mpfr_t x; int i, j; @@ -1210,7 +1210,7 @@ main (int argc, char *argv[]) char s[MAX_DIGITS + 2]; mp_exp_t e, f; size_t m; - mp_prec_t p; + mpfr_prec_t p; int i; tests_start_mpfr (); diff --git a/tests/tgmpop.c b/tests/tgmpop.c index 28fd80842..093f63d92 100644 --- a/tests/tgmpop.c +++ b/tests/tgmpop.c @@ -199,11 +199,11 @@ check_for_zero (void) } static void -test_cmp_z (mp_prec_t pmin, mp_prec_t pmax, int nmax) +test_cmp_z (mpfr_prec_t pmin, mpfr_prec_t pmax, int nmax) { mpfr_t x, z; mpz_t y; - mp_prec_t p; + mpfr_prec_t p; int res1, res2; int n; @@ -237,11 +237,11 @@ test_cmp_z (mp_prec_t pmin, mp_prec_t pmax, int nmax) } static void -test_cmp_q (mp_prec_t pmin, mp_prec_t pmax, int nmax) +test_cmp_q (mpfr_prec_t pmin, mpfr_prec_t pmax, int nmax) { mpfr_t x, z; mpq_t y; - mp_prec_t p; + mpfr_prec_t p; int res1, res2; int n; @@ -275,11 +275,11 @@ test_cmp_q (mp_prec_t pmin, mp_prec_t pmax, int nmax) } static void -test_cmp_f (mp_prec_t pmin, mp_prec_t pmax, int nmax) +test_cmp_f (mpfr_prec_t pmin, mpfr_prec_t pmax, int nmax) { mpfr_t x, z; mpf_t y; - mp_prec_t p; + mpfr_prec_t p; int res1, res2; int n; @@ -390,11 +390,11 @@ test_specialz (int (*mpfr_func)(mpfr_ptr, mpfr_srcptr, mpz_srcptr, mpfr_rnd_t), } static void -test_genericz (mp_prec_t p0, mp_prec_t p1, unsigned int N, +test_genericz (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int N, int (*func)(mpfr_ptr, mpfr_srcptr, mpz_srcptr, mpfr_rnd_t), const char *op) { - mp_prec_t prec; + mpfr_prec_t prec; mpfr_t arg1, dst_big, dst_small, tmp; mpz_t arg2; mpfr_rnd_t rnd; @@ -467,11 +467,11 @@ test_genericz (mp_prec_t p0, mp_prec_t p1, unsigned int N, } static void -test_genericq (mp_prec_t p0, mp_prec_t p1, unsigned int N, +test_genericq (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int N, int (*func)(mpfr_ptr, mpfr_srcptr, mpq_srcptr, mpfr_rnd_t), const char *op) { - mp_prec_t prec; + mpfr_prec_t prec; mpfr_t arg1, dst_big, dst_small, tmp; mpq_t arg2; mpfr_rnd_t rnd; @@ -547,7 +547,7 @@ test_genericq (mp_prec_t p0, mp_prec_t p1, unsigned int N, } static void -test_specialq (mp_prec_t p0, mp_prec_t p1, unsigned int N, +test_specialq (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int N, int (*mpfr_func)(mpfr_ptr, mpfr_srcptr, mpq_srcptr, mpfr_rnd_t), void (*mpq_func)(mpq_ptr, mpq_srcptr, mpq_srcptr), const char *op) @@ -555,7 +555,7 @@ test_specialq (mp_prec_t p0, mp_prec_t p1, unsigned int N, mpfr_t fra, frb, frq; mpq_t q1, q2, qr; unsigned int n; - mp_prec_t prec; + mpfr_prec_t prec; for (prec = p0 ; prec < p1 ; prec++) { diff --git a/tests/tmodf.c b/tests/tmodf.c index bf83dcf12..8c47370b5 100644 --- a/tests/tmodf.c +++ b/tests/tmodf.c @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static void check (const char *xis, const char *xfs, const char *xs, - mp_prec_t xip, mp_prec_t xfp, mp_prec_t xp, + mpfr_prec_t xip, mpfr_prec_t xfp, mpfr_prec_t xp, int expected_return, mpfr_rnd_t rnd_mode) { int inexact; diff --git a/tests/tmul.c b/tests/tmul.c index b5da995b2..6689cda39 100644 --- a/tests/tmul.c +++ b/tests/tmul.c @@ -210,7 +210,7 @@ static void check_exact (void) { mpfr_t a, b, c, d; - mp_prec_t prec; + mpfr_prec_t prec; int i, inexact; mpfr_rnd_t rnd; diff --git a/tests/tmul_ui.c b/tests/tmul_ui.c index 2441a021b..6aca85ccb 100644 --- a/tests/tmul_ui.c +++ b/tests/tmul_ui.c @@ -26,11 +26,11 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-test.h" static void -check_inexact (mp_prec_t p) +check_inexact (mpfr_prec_t p) { mpfr_t x, y, z; unsigned long u; - mp_prec_t q; + mpfr_prec_t q; int inexact, cmp; int rnd; @@ -85,7 +85,7 @@ main (int argc, char *argv[]) { mpfr_t x, y; unsigned int xprec, yprec, i; - mp_prec_t p; + mpfr_prec_t p; mp_exp_t emax; tests_start_mpfr (); diff --git a/tests/tnext.c b/tests/tnext.c index 1301d8c50..64772c4e0 100644 --- a/tests/tnext.c +++ b/tests/tnext.c @@ -34,7 +34,7 @@ generic_abovebelow (void) for (i = 0; i < 20000; i++) { mpfr_t x, y, z, t; - mp_prec_t prec; + mpfr_prec_t prec; int neg, below; prec = (randlimb () % 300) + MPFR_PREC_MIN; @@ -97,7 +97,7 @@ inverse_test (void) { static const char *tests[] = { "0", "1", "2", "3.1", "Inf" }; int i, neg, below; - mp_prec_t prec; + mpfr_prec_t prec; for (i = 0; i < (int) (sizeof(tests) / sizeof(tests[0])); i++) for (neg = 0; neg <= 1; neg++) diff --git a/tests/tpow.c b/tests/tpow.c index fbc5147b1..982d741ac 100644 --- a/tests/tpow.c +++ b/tests/tpow.c @@ -411,11 +411,11 @@ pow_si_long_min (void) } static void -check_inexact (mp_prec_t p) +check_inexact (mpfr_prec_t p) { mpfr_t x, y, z, t; unsigned long u; - mp_prec_t q; + mpfr_prec_t q; int inexact, cmp; int rnd; @@ -1371,7 +1371,7 @@ bug20080820 (void) int main (int argc, char **argv) { - mp_prec_t p; + mpfr_prec_t p; tests_start_mpfr (); diff --git a/tests/tpow3.c b/tests/tpow3.c index 17f97bcc5..28fcaff86 100644 --- a/tests/tpow3.c +++ b/tests/tpow3.c @@ -32,13 +32,13 @@ main (int argc, char *argv[]) { mpfr_t x, y, z; - mp_prec_t prec, yprec; + mpfr_prec_t prec, yprec; mpfr_t t, s; mpfr_rnd_t rnd; int inexact, compare, compare2; unsigned int n, err; - mp_prec_t p0=2, p1=100; + mpfr_prec_t p0=2, p1=100; unsigned int N=25; tests_start_mpfr (); diff --git a/tests/tpow_z.c b/tests/tpow_z.c index baa8b9434..6f6baf50b 100644 --- a/tests/tpow_z.c +++ b/tests/tpow_z.c @@ -138,12 +138,12 @@ check_special (void) } static void -check_integer (mp_prec_t begin, mp_prec_t end, unsigned long max) +check_integer (mpfr_prec_t begin, mpfr_prec_t end, unsigned long max) { mpfr_t x, y1, y2; mpz_t z; unsigned long i, n; - mp_prec_t p; + mpfr_prec_t p; int res1, res2; mpfr_rnd_t rnd; diff --git a/tests/trandom.c b/tests/trandom.c index 6741e9b30..72df33d68 100644 --- a/tests/trandom.c +++ b/tests/trandom.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static void -test_urandomb (long nbtests, mp_prec_t prec, int verbose) +test_urandomb (long nbtests, mpfr_prec_t prec, int verbose) { mpfr_t x; int *tab, size_tab, k, sh, xn; @@ -107,7 +107,7 @@ int main (int argc, char *argv[]) { long nbtests; - mp_prec_t prec; + mpfr_prec_t prec; int verbose = 0; tests_start_mpfr (); diff --git a/tests/trint.c b/tests/trint.c index f015b9eac..19b12f42b 100644 --- a/tests/trint.c +++ b/tests/trint.c @@ -211,7 +211,7 @@ test_against_libc (void) #endif static void -err (char *str, mp_size_t s, mpfr_t x, mpfr_t y, mp_prec_t p, mpfr_rnd_t r, +err (char *str, mp_size_t s, mpfr_t x, mpfr_t y, mpfr_prec_t p, mpfr_rnd_t r, int trint, int inexact) { printf ("Error: %s\ns = %u, p = %u, r = %s, trint = %d, inexact = %d\nx = ", @@ -229,7 +229,7 @@ main (int argc, char *argv[]) { mp_size_t s; mpz_t z; - mp_prec_t p; + mpfr_prec_t p; mpfr_t x, y, t, u, v; int r; int inexact, sign_t; diff --git a/tests/troot.c b/tests/troot.c index c1a848989..28ab0a1fa 100644 --- a/tests/troot.c +++ b/tests/troot.c @@ -265,7 +265,7 @@ main (void) { mpfr_t x; int r; - mp_prec_t p; + mpfr_prec_t p; unsigned long k; tests_start_mpfr (); diff --git a/tests/tset_sj.c b/tests/tset_sj.c index 20bbac2c7..6834baf1a 100644 --- a/tests/tset_sj.c +++ b/tests/tset_sj.c @@ -63,10 +63,10 @@ inexact_sign (int x) } static void -check_set_uj (mp_prec_t pmin, mp_prec_t pmax, int N) +check_set_uj (mpfr_prec_t pmin, mpfr_prec_t pmax, int N) { mpfr_t x, y; - mp_prec_t p; + mpfr_prec_t p; int inex1, inex2, n; mp_limb_t limb; diff --git a/tests/tsin.c b/tests/tsin.c index 9ae5bb6f4..29e1bf1c4 100644 --- a/tests/tsin.c +++ b/tests/tsin.c @@ -205,7 +205,7 @@ static void check_regression (void) { mpfr_t x, y; - mp_prec_t p; + mpfr_prec_t p; int i; p = strlen (xs) - 2 - 3; diff --git a/tests/tsin_cos.c b/tests/tsin_cos.c index 87b334340..2fc45b3c2 100644 --- a/tests/tsin_cos.c +++ b/tests/tsin_cos.c @@ -312,7 +312,7 @@ static void test_mpfr_sincos_fast (void) { mpfr_t x, y, z, yref, zref, h; - mp_prec_t p = 1000; + mpfr_prec_t p = 1000; int i, inex, inexref; mpfr_rnd_t r; @@ -372,7 +372,7 @@ static void bug20091007 (void) { mpfr_t x, y, z, yref, zref; - mp_prec_t p = 1000; + mpfr_prec_t p = 1000; int inex, inexref; mpfr_rnd_t r = MPFR_RNDZ; @@ -420,7 +420,7 @@ static void bug20091008 (void) { mpfr_t x, y, z, yref, zref; - mp_prec_t p = 1000; + mpfr_prec_t p = 1000; int inex, inexref; mpfr_rnd_t r = MPFR_RNDN; @@ -468,7 +468,7 @@ static void bug20091013 (void) { mpfr_t x, y, z, yref, zref; - mp_prec_t p = 1000; + mpfr_prec_t p = 1000; int inex, inexref; mpfr_rnd_t r = MPFR_RNDN; @@ -519,7 +519,7 @@ static void bug20091122 (void) { mpfr_t x, y, z, yref, zref; - mp_prec_t p = 3; + mpfr_prec_t p = 3; mpfr_rnd_t r = MPFR_RNDN; mpfr_init2 (x, 5); diff --git a/tests/tsqrt.c b/tests/tsqrt.c index 9c147ddcf..505c53c32 100644 --- a/tests/tsqrt.c +++ b/tests/tsqrt.c @@ -110,7 +110,7 @@ check24 (const char *as, mpfr_rnd_t rnd_mode, const char *qs) } static void -check_diverse (const char *as, mp_prec_t p, const char *qs) +check_diverse (const char *as, mpfr_prec_t p, const char *qs) { mpfr_t q; @@ -187,7 +187,7 @@ special (void) { mpfr_t x, y, z; int inexact; - mp_prec_t p; + mpfr_prec_t p; mpfr_init (x); mpfr_init (y); @@ -419,7 +419,7 @@ special (void) } static void -check_inexact (mp_prec_t p) +check_inexact (mpfr_prec_t p) { mpfr_t x, y, z; mpfr_rnd_t rnd; @@ -499,7 +499,7 @@ check_nan (void) /* check that -1 <= x/sqrt(x^2+s*y^2) <= 1 for rounding to nearest or up with s = 0 and s = 1 */ static void -test_property1 (mp_prec_t p, mpfr_rnd_t r, int s) +test_property1 (mpfr_prec_t p, mpfr_rnd_t r, int s) { mpfr_t x, y, z, t; @@ -538,7 +538,7 @@ test_property1 (mp_prec_t p, mpfr_rnd_t r, int s) /* check sqrt(x^2) = x */ static void -test_property2 (mp_prec_t p, mpfr_rnd_t r) +test_property2 (mpfr_prec_t p, mpfr_rnd_t r) { mpfr_t x, y; @@ -568,7 +568,7 @@ test_property2 (mp_prec_t p, mpfr_rnd_t r) int main (void) { - mp_prec_t p; + mpfr_prec_t p; int k; tests_start_mpfr (); diff --git a/tests/tstckintc.c b/tests/tstckintc.c index a7e0dfa35..84321b918 100644 --- a/tests/tstckintc.c +++ b/tests/tstckintc.c @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., long Buffer[BUFFER_SIZE]; char *stack = (char *) Buffer; -mp_prec_t p = PREC_TESTED; +mpfr_prec_t p = PREC_TESTED; #define ALIGNED(s) (((s) + sizeof (long) - 1) / sizeof (long) * sizeof (long)) @@ -48,7 +48,7 @@ new_st (size_t s) /* Alloc a new mpfr_t on the main stack */ static mpfr_ptr -new_mpfr (mp_prec_t p) +new_mpfr (mpfr_prec_t p) { mpfr_ptr x = (mpfr_ptr) new_st (sizeof (mpfr_t)); void *mantissa = new_st (mpfr_custom_get_size (p)); diff --git a/tests/tstrtofr.c b/tests/tstrtofr.c index d88abfd00..0620a3724 100644 --- a/tests/tstrtofr.c +++ b/tests/tstrtofr.c @@ -256,12 +256,12 @@ main (void) { int i, base; mpfr_t x; - mp_prec_t p; + mpfr_prec_t p; mp_exp_t e; mpfr_init (x); printf ("struct dymmy_test { \n" - " mp_prec_t prec; \n" + " mpfr_prec_t prec; \n" " int base; \n" " const char *str; \n" " const char *binstr; \n" @@ -286,7 +286,7 @@ main (void) #endif static struct dymmy_test { - mp_prec_t prec; + mpfr_prec_t prec; int base; const char *str; const char *binstr; @@ -598,7 +598,7 @@ check_reftable (void) { int i, base; mpfr_t x, y; - mp_prec_t p; + mpfr_prec_t p; char *s; mpfr_init2 (x, 200); diff --git a/tests/tsub.c b/tests/tsub.c index de4a35543..331aca41c 100644 --- a/tests/tsub.c +++ b/tests/tsub.c @@ -351,7 +351,7 @@ bug_ddefour(void) /* if u = o(x-y), v = o(u-x), w = o(v+y), then x-y = u-w */ static void -check_two_sum (mp_prec_t p) +check_two_sum (mpfr_prec_t p) { mpfr_t x, y, u, v, w; mpfr_rnd_t rnd; @@ -398,7 +398,7 @@ static void check_inexact (void) { mpfr_t x, y, z, u; - mp_prec_t px, py, pu, pz; + mpfr_prec_t px, py, pu, pz; int inexact, cmp; mpfr_rnd_t rnd; @@ -486,7 +486,7 @@ check_inexact (void) int main (void) { - mp_prec_t p; + mpfr_prec_t p; unsigned int i; tests_start_mpfr (); diff --git a/tests/tsub_ui.c b/tests/tsub_ui.c index 5f91a026a..da16620de 100644 --- a/tests/tsub_ui.c +++ b/tests/tsub_ui.c @@ -50,7 +50,7 @@ check3 (const char *xs, unsigned long y, mpfr_rnd_t rnd_mode, const char *zs) then x + y = u + w thus if u = o(y-x), v = o(u+x), w = o(v-y), then y-x = u-w */ static void -check_two_sum (mp_prec_t p) +check_two_sum (mpfr_prec_t p) { unsigned int x; mpfr_t y, u, v, w; @@ -123,7 +123,7 @@ check_nans (void) int main (int argc, char *argv[]) { - mp_prec_t p; + mpfr_prec_t p; int k; tests_start_mpfr (); diff --git a/tests/tsum.c b/tests/tsum.c index 27a2e9ea1..51c5ce936 100644 --- a/tests/tsum.c +++ b/tests/tsum.c @@ -54,10 +54,10 @@ sum_tab (mpfr_ptr ret, mpfr_t *tab, unsigned long n, mpfr_rnd_t rnd) } -static mp_prec_t -get_prec_max (mpfr_t *tab, unsigned long n, mp_prec_t f) +static mpfr_prec_t +get_prec_max (mpfr_t *tab, unsigned long n, mpfr_prec_t f) { - mp_prec_t res; + mpfr_prec_t res; mp_exp_t min, max; unsigned long i; @@ -81,10 +81,10 @@ get_prec_max (mpfr_t *tab, unsigned long n, mp_prec_t f) static void -algo_exact (mpfr_t somme, mpfr_t *tab, unsigned long n, mp_prec_t f) +algo_exact (mpfr_t somme, mpfr_t *tab, unsigned long n, mpfr_prec_t f) { unsigned long i; - mp_prec_t prec_max; + mpfr_prec_t prec_max; prec_max = get_prec_max(tab, n, f); mpfr_set_prec (somme, prec_max); @@ -101,7 +101,7 @@ algo_exact (mpfr_t somme, mpfr_t *tab, unsigned long n, mp_prec_t f) /* Test the sorting function */ static void -test_sort (mp_prec_t f, unsigned long n) +test_sort (mpfr_prec_t f, unsigned long n) { mpfr_t *tab; mpfr_ptr *tabtmp; @@ -140,7 +140,7 @@ test_sort (mp_prec_t f, unsigned long n) } static void -test_sum (mp_prec_t f, unsigned long n) +test_sum (mpfr_prec_t f, unsigned long n) { mpfr_t sum, real_sum, real_non_rounded; mpfr_t *tab; @@ -284,7 +284,7 @@ void check_special (void) int main (void) { - mp_prec_t p; + mpfr_prec_t p; unsigned long n; tests_start_mpfr (); diff --git a/tests/tui_div.c b/tests/tui_div.c index e9203765c..d26170d31 100644 --- a/tests/tui_div.c +++ b/tests/tui_div.c @@ -49,7 +49,7 @@ static void check_inexact (void) { mpfr_t x, y, z; - mp_prec_t px, py; + mpfr_prec_t px, py; int inexact, cmp; unsigned long int u; int rnd; diff --git a/tests/tui_pow.c b/tests/tui_pow.c index d9741f686..7fc8f7f69 100644 --- a/tests/tui_pow.c +++ b/tests/tui_pow.c @@ -84,11 +84,11 @@ test1 (void) } static void -check1 (mpfr_ptr x, mp_prec_t prec, unsigned long nt, mpfr_rnd_t rnd) +check1 (mpfr_ptr x, mpfr_prec_t prec, unsigned long nt, mpfr_rnd_t rnd) { mpfr_t y, z, t; int inexact, compare, compare2; - mp_prec_t yprec; + mpfr_prec_t yprec; mp_exp_t err; yprec = prec + 10; @@ -190,11 +190,11 @@ main (int argc, char *argv[]) { mpfr_t z, t; - mp_prec_t prec; + mpfr_prec_t prec; mpfr_rnd_t rnd; unsigned int n; - mp_prec_t p0=2, p1=100; + mpfr_prec_t p0=2, p1=100; unsigned int N=20; mpfr_init2 (z, 38); diff --git a/tests/tui_sub.c b/tests/tui_sub.c index df06cf402..69532753c 100644 --- a/tests/tui_sub.c +++ b/tests/tui_sub.c @@ -162,7 +162,7 @@ check (unsigned long y, const char *xs, mpfr_rnd_t rnd_mode, const char *zs) /* if u = o(x-y), v = o(u-x), w = o(v+y), then x-y = u-w */ static void -check_two_sum (mp_prec_t p) +check_two_sum (mpfr_prec_t p) { unsigned int x; mpfr_t y, u, v, w; @@ -265,7 +265,7 @@ static void check_neg (void) int main (int argc, char *argv[]) { - mp_prec_t p; + mpfr_prec_t p; unsigned k; tests_start_mpfr (); diff --git a/tests/turandom.c b/tests/turandom.c index 8e324362c..519bd886b 100644 --- a/tests/turandom.c +++ b/tests/turandom.c @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-test.h" static void -test_urandom (long nbtests, mp_prec_t prec, mpfr_rnd_t rnd, long bit_index, +test_urandom (long nbtests, mpfr_prec_t prec, mpfr_rnd_t rnd, long bit_index, int verbose) { mpfr_t x; @@ -158,7 +158,7 @@ int main (int argc, char *argv[]) { long nbtests; - mp_prec_t prec; + mpfr_prec_t prec; int verbose = 0; mpfr_rnd_t rnd; long bit_index; diff --git a/tests/tyn.c b/tests/tyn.c index 62db69aab..5618aa8d5 100644 --- a/tests/tyn.c +++ b/tests/tyn.c @@ -30,7 +30,7 @@ main (int argc, char *argv[]) { mpfr_t x, y; long n; - mp_prec_t prec = 53; + mpfr_prec_t prec = 53; tests_start_mpfr (); diff --git a/tests/tzeta.c b/tests/tzeta.c index b278b3a52..c75292a99 100644 --- a/tests/tzeta.c +++ b/tests/tzeta.c @@ -199,7 +199,7 @@ int main (int argc, char *argv[]) { mpfr_t s, y, z; - mp_prec_t prec; + mpfr_prec_t prec; mpfr_rnd_t rnd_mode; int inex; @@ -150,7 +150,7 @@ int verbose; We can't use the GNU MPFR library since the thresholds are fixed macros. */ /* Setup mpfr_exp_2 */ -mp_prec_t mpfr_exp_2_threshold; +mpfr_prec_t mpfr_exp_2_threshold; #undef MPFR_EXP_2_THRESHOLD #define MPFR_EXP_2_THRESHOLD mpfr_exp_2_threshold #include "exp_2.c" @@ -159,7 +159,7 @@ static double speed_mpfr_exp_2 (struct speed_params *s) { } /* Setup mpfr_exp */ -mp_prec_t mpfr_exp_threshold; +mpfr_prec_t mpfr_exp_threshold; #undef MPFR_EXP_THRESHOLD #define MPFR_EXP_THRESHOLD mpfr_exp_threshold #include "exp.c" @@ -168,7 +168,7 @@ static double speed_mpfr_exp (struct speed_params *s) { } /* Setup mpfr_sin_cos */ -mp_prec_t mpfr_sincos_threshold; +mpfr_prec_t mpfr_sincos_threshold; #undef MPFR_SINCOS_THRESHOLD #define MPFR_SINCOS_THRESHOLD mpfr_sincos_threshold #include "sin_cos.c" @@ -178,7 +178,7 @@ static double speed_mpfr_sincos (struct speed_params *s) { } /* Setup mpfr_mul */ -mp_prec_t mpfr_mul_threshold; +mpfr_prec_t mpfr_mul_threshold; #undef MPFR_MUL_THRESHOLD #define MPFR_MUL_THRESHOLD mpfr_mul_threshold #include "mul.c" @@ -217,9 +217,9 @@ analyze_data (double *dat, int ndat) { #define THRESHOLD_WINDOW 16 #define THRESHOLD_FINAL_WINDOW 128 -static double domeasure (mp_prec_t *threshold, +static double domeasure (mpfr_prec_t *threshold, double (*func) (struct speed_params *), - mp_prec_t p) + mpfr_prec_t p) { struct speed_params s; mp_size_t size; @@ -269,15 +269,15 @@ static double domeasure (mp_prec_t *threshold, if algo2 is better for low prec, and algo1 better for high prec, the behaviour of this function is undefined. */ static void -tune_simple_func (mp_prec_t *threshold, +tune_simple_func (mpfr_prec_t *threshold, double (*func) (struct speed_params *), - mp_prec_t pstart) + mpfr_prec_t pstart) { double measure[THRESHOLD_FINAL_WINDOW+1]; double d; - mp_prec_t pstep; + mpfr_prec_t pstep; int i, numpos, numneg, try; - mp_prec_t pmin, pmax, p; + mpfr_prec_t pmin, pmax, p; /* first look for a lower bound within 10% */ pmin = p = pstart; diff --git a/ui_pow_ui.c b/ui_pow_ui.c index 83fb0c28c..43154fe51 100644 --- a/ui_pow_ui.c +++ b/ui_pow_ui.c @@ -29,7 +29,7 @@ mpfr_ui_pow_ui (mpfr_ptr x, unsigned long int y, unsigned long int n, mp_exp_t err; unsigned long m; mpfr_t res; - mp_prec_t prec; + mpfr_prec_t prec; int size_n; int inexact; MPFR_ZIV_DECL (loop); @@ -41,7 +41,7 @@ int mpfr_urandom (mpfr_ptr rop, gmp_randstate_t rstate, mpfr_rnd_t rnd_mode) { mp_ptr rp; - mp_prec_t nbits; + mpfr_prec_t nbits; mp_size_t nlimbs; mp_size_t n; mp_exp_t exp; diff --git a/urandomb.c b/urandomb.c index b03bbc800..d59ca3cab 100644 --- a/urandomb.c +++ b/urandomb.c @@ -42,7 +42,7 @@ int mpfr_urandomb (mpfr_ptr rop, gmp_randstate_t rstate) { mp_ptr rp; - mp_prec_t nbits; + mpfr_prec_t nbits; mp_size_t nlimbs; mp_size_t k; /* number of high zero limbs */ mp_exp_t exp; diff --git a/vasprintf.c b/vasprintf.c index 6079de0fe..191525bf5 100644 --- a/vasprintf.c +++ b/vasprintf.c @@ -63,7 +63,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define MPFR_NEED_LONGLONG_H #include "mpfr-impl.h" -/* Define a length modifier corresponding to mp_prec_t. +/* Define a length modifier corresponding to mpfr_prec_t. We use literal string instead of literal character so as to permit future extension to long long int ("ll"). */ #if _MPFR_PREC_FORMAT == 1 @@ -779,7 +779,7 @@ struct number_parts static int next_base_power_p (mpfr_srcptr x, int base, mpfr_rnd_t rnd) { - mp_prec_t nbits; + mpfr_prec_t nbits; mp_limb_t pm; mp_limb_t xm; @@ -818,10 +818,10 @@ next_base_power_p (mpfr_srcptr x, int base, mpfr_rnd_t rnd) Return +1 if x is rounded up to 10^f, return zero otherwise. If e is not NULL, *e is set to f. */ static int -round_to_10_power (mp_exp_t *e, mpfr_srcptr x, mp_prec_t p, mpfr_rnd_t r) +round_to_10_power (mp_exp_t *e, mpfr_srcptr x, mpfr_prec_t p, mpfr_rnd_t r) { mpfr_t f, u, v, y; - mp_prec_t m; + mpfr_prec_t m; mp_exp_t ex; mpfr_uexp_t uexp; int roundup = -1; /* boolean (-1: not set) */ @@ -2082,7 +2082,7 @@ mpfr_vasprintf (char **ptr, const char *fmt, va_list ap) case */ } else if (spec.arg_type == MPFR_PREC_ARG) - /* output mp_prec_t variable */ + /* output mpfr_prec_t variable */ { char *s; char format[MPFR_PREC_FORMAT_SIZE + 6]; /* see examples below */ @@ -212,7 +212,7 @@ mpfr_yn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r) if (n == 0 && MPFR_EXP(z) < - (mp_exp_t) (MPFR_PREC(res) / 2)) { mpfr_t l, h, t, logz; - mp_prec_t prec; + mpfr_prec_t prec; int ok, inex2; prec = MPFR_PREC(res) + 10; @@ -268,7 +268,7 @@ mpfr_yn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r) if (n == 1 && MPFR_EXP(z) + 1 < - (mp_exp_t) MPFR_PREC(res)) { mpfr_t y; - mp_prec_t prec; + mpfr_prec_t prec; mp_exp_t err1; int ok; MPFR_BLOCK_DECL (flags); @@ -315,7 +315,7 @@ mpfr_yn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r) /* General case */ { - mp_prec_t prec; + mpfr_prec_t prec; mp_exp_t err1, err2, err3; mpfr_t y, s1, s2, s3; MPFR_ZIV_DECL (loop); @@ -144,7 +144,7 @@ mpfr_zeta_pos (mpfr_t z, mpfr_srcptr s, mpfr_rnd_t rnd_mode) mpfr_t b, c, z_pre, f, s1; double beta, sd, dnep; mpfr_t *tc1; - mp_prec_t precz, precs, d, dint; + mpfr_prec_t precz, precs, d, dint; int p, n, l, add; int inex; MPFR_GROUP_DECL (group); @@ -300,7 +300,7 @@ mpfr_zeta (mpfr_t z, mpfr_srcptr s, mpfr_rnd_t rnd_mode) mpfr_t z_pre, s1, y, p; double sd, eps, m1, c; long add; - mp_prec_t precz, prec1, precs, precs1; + mpfr_prec_t precz, prec1, precs, precs1; int inex; MPFR_GROUP_DECL (group); MPFR_ZIV_DECL (loop); @@ -43,7 +43,7 @@ mpfr_zeta_ui (mpfr_ptr z, unsigned long m, mpfr_rnd_t r) } else /* m >= 2 */ { - mp_prec_t p = MPFR_PREC(z); + mpfr_prec_t p = MPFR_PREC(z); unsigned long n, k, err, kbits; mpz_t d, t, s, q; mpfr_t y; |