diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-06-26 15:35:01 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-06-26 15:35:01 +0000 |
commit | 3f944f217a6bc9b3d72b73067de160e768f6a4e3 (patch) | |
tree | 89d977f3c15ee4383fe0629c40f504c14a352090 | |
parent | 0a7b8e19cf4789f503f55b4e046327c38ab786b3 (diff) | |
download | mpfr-3f944f217a6bc9b3d72b73067de160e768f6a4e3.tar.gz |
mp_rnd_t -> mpfr_rnd_t
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6295 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | README.dev | 4 | ||||
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | acos.c | 2 | ||||
-rw-r--r-- | acosh.c | 2 | ||||
-rw-r--r-- | add.c | 2 | ||||
-rw-r--r-- | add1.c | 2 | ||||
-rw-r--r-- | add1sp.c | 6 | ||||
-rw-r--r-- | add_d.c | 2 | ||||
-rw-r--r-- | add_ui.c | 2 | ||||
-rw-r--r-- | agm.c | 2 | ||||
-rw-r--r-- | asin.c | 2 | ||||
-rw-r--r-- | asinh.c | 2 | ||||
-rw-r--r-- | atan.c | 2 | ||||
-rw-r--r-- | atan2.c | 2 | ||||
-rw-r--r-- | atanh.c | 2 | ||||
-rw-r--r-- | cache.c | 4 | ||||
-rw-r--r-- | cbrt.c | 2 | ||||
-rw-r--r-- | const_catalan.c | 4 | ||||
-rw-r--r-- | const_euler.c | 4 | ||||
-rw-r--r-- | const_log2.c | 4 | ||||
-rw-r--r-- | const_pi.c | 4 | ||||
-rw-r--r-- | copysign.c | 2 | ||||
-rw-r--r-- | cos.c | 2 | ||||
-rw-r--r-- | cosh.c | 2 | ||||
-rw-r--r-- | d_div.c | 2 | ||||
-rw-r--r-- | d_sub.c | 2 | ||||
-rw-r--r-- | dim.c | 2 | ||||
-rw-r--r-- | div.c | 2 | ||||
-rw-r--r-- | div_2exp.c | 2 | ||||
-rw-r--r-- | div_2si.c | 2 | ||||
-rw-r--r-- | div_2ui.c | 2 | ||||
-rw-r--r-- | div_d.c | 2 | ||||
-rw-r--r-- | div_ui.c | 4 | ||||
-rw-r--r-- | eint.c | 2 | ||||
-rw-r--r-- | erf.c | 8 | ||||
-rw-r--r-- | erfc.c | 2 | ||||
-rw-r--r-- | exceptions.c | 6 | ||||
-rw-r--r-- | exp.c | 2 | ||||
-rw-r--r-- | exp10.c | 2 | ||||
-rw-r--r-- | exp2.c | 4 | ||||
-rw-r--r-- | exp3.c | 2 | ||||
-rw-r--r-- | exp_2.c | 2 | ||||
-rw-r--r-- | expm1.c | 2 | ||||
-rw-r--r-- | factorial.c | 4 | ||||
-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 | 2 | ||||
-rw-r--r-- | gamma.c | 2 | ||||
-rw-r--r-- | gen_inverse.h | 2 | ||||
-rw-r--r-- | get_d.c | 4 | ||||
-rw-r--r-- | get_d64.c | 2 | ||||
-rw-r--r-- | get_f.c | 2 | ||||
-rw-r--r-- | get_ld.c | 6 | ||||
-rw-r--r-- | get_si.c | 2 | ||||
-rw-r--r-- | get_str.c | 8 | ||||
-rw-r--r-- | get_ui.c | 2 | ||||
-rw-r--r-- | get_z.c | 2 | ||||
-rw-r--r-- | gmp_op.c | 20 | ||||
-rw-r--r-- | hypot.c | 2 | ||||
-rw-r--r-- | inp_str.c | 2 | ||||
-rw-r--r-- | jn.c | 8 | ||||
-rw-r--r-- | jyn_asympt.c | 2 | ||||
-rw-r--r-- | lngamma.c | 6 | ||||
-rw-r--r-- | log.c | 2 | ||||
-rw-r--r-- | log10.c | 2 | ||||
-rw-r--r-- | log1p.c | 2 | ||||
-rw-r--r-- | log2.c | 2 | ||||
-rw-r--r-- | minmax.c | 4 | ||||
-rw-r--r-- | mpfr-impl.h | 38 | ||||
-rw-r--r-- | mpfr.h | 14 | ||||
-rw-r--r-- | mpfr.texi | 358 | ||||
-rw-r--r-- | mul.c | 8 | ||||
-rw-r--r-- | mul_2exp.c | 2 | ||||
-rw-r--r-- | mul_2si.c | 2 | ||||
-rw-r--r-- | mul_2ui.c | 2 | ||||
-rw-r--r-- | mul_d.c | 2 | ||||
-rw-r--r-- | mul_ui.c | 4 | ||||
-rw-r--r-- | neg.c | 2 | ||||
-rw-r--r-- | out_str.c | 2 | ||||
-rw-r--r-- | pow.c | 6 | ||||
-rw-r--r-- | pow_si.c | 4 | ||||
-rw-r--r-- | pow_ui.c | 4 | ||||
-rw-r--r-- | pow_z.c | 8 | ||||
-rw-r--r-- | print_rnd_mode.c | 2 | ||||
-rw-r--r-- | rec_sqrt.c | 2 | ||||
-rw-r--r-- | reldiff.c | 2 | ||||
-rw-r--r-- | rem1.c | 10 | ||||
-rw-r--r-- | root.c | 2 | ||||
-rw-r--r-- | round_near_x.c | 4 | ||||
-rw-r--r-- | round_prec.c | 8 | ||||
-rw-r--r-- | round_raw_generic.c | 2 | ||||
-rw-r--r-- | set.c | 6 | ||||
-rw-r--r-- | set_d.c | 2 | ||||
-rw-r--r-- | set_d64.c | 2 | ||||
-rw-r--r-- | set_f.c | 2 | ||||
-rw-r--r-- | set_ld.c | 4 | ||||
-rw-r--r-- | set_q.c | 2 | ||||
-rw-r--r-- | set_rnd.c | 6 | ||||
-rw-r--r-- | set_si.c | 2 | ||||
-rw-r--r-- | set_si_2exp.c | 2 | ||||
-rw-r--r-- | set_sj.c | 4 | ||||
-rw-r--r-- | set_str.c | 4 | ||||
-rw-r--r-- | set_ui.c | 2 | ||||
-rw-r--r-- | set_ui_2exp.c | 2 | ||||
-rw-r--r-- | set_uj.c | 4 | ||||
-rw-r--r-- | set_z.c | 2 | ||||
-rw-r--r-- | setsign.c | 2 | ||||
-rw-r--r-- | si_op.c | 6 | ||||
-rw-r--r-- | sin.c | 2 | ||||
-rw-r--r-- | sin_cos.c | 2 | ||||
-rw-r--r-- | sinh.c | 2 | ||||
-rw-r--r-- | sinh_cosh.c | 2 | ||||
-rw-r--r-- | sqr.c | 2 | ||||
-rw-r--r-- | sqrt.c | 2 | ||||
-rw-r--r-- | sqrt_ui.c | 2 | ||||
-rw-r--r-- | strtofr.c | 4 | ||||
-rw-r--r-- | sub.c | 2 | ||||
-rw-r--r-- | sub1.c | 2 | ||||
-rw-r--r-- | sub1sp.c | 6 | ||||
-rw-r--r-- | sub_d.c | 2 | ||||
-rw-r--r-- | sub_ui.c | 2 | ||||
-rw-r--r-- | subnormal.c | 2 | ||||
-rw-r--r-- | sum.c | 2 | ||||
-rw-r--r-- | tan.c | 2 | ||||
-rw-r--r-- | tanh.c | 2 | ||||
-rw-r--r-- | tests/cmp_str.c | 2 | ||||
-rw-r--r-- | tests/mpfr-test.h | 8 | ||||
-rw-r--r-- | tests/reuse.c | 208 | ||||
-rw-r--r-- | tests/rnd_mode.c | 2 | ||||
-rw-r--r-- | tests/tabs.c | 4 | ||||
-rw-r--r-- | tests/tacos.c | 12 | ||||
-rw-r--r-- | tests/tadd.c | 16 | ||||
-rw-r--r-- | tests/tadd1sp.c | 16 | ||||
-rw-r--r-- | tests/tadd_ui.c | 2 | ||||
-rw-r--r-- | tests/tagm.c | 2 | ||||
-rw-r--r-- | tests/tasin.c | 12 | ||||
-rw-r--r-- | tests/tatan.c | 18 | ||||
-rw-r--r-- | tests/taway.c | 24 | ||||
-rw-r--r-- | tests/tcan_round.c | 2 | ||||
-rw-r--r-- | tests/tcbrt.c | 10 | ||||
-rw-r--r-- | tests/tcmp.c | 8 | ||||
-rw-r--r-- | tests/tcmpabs.c | 8 | ||||
-rw-r--r-- | tests/tconst_catalan.c | 2 | ||||
-rw-r--r-- | tests/tconst_euler.c | 12 | ||||
-rw-r--r-- | tests/tconst_log2.c | 8 | ||||
-rw-r--r-- | tests/tconst_pi.c | 6 | ||||
-rw-r--r-- | tests/tcopysign.c | 2 | ||||
-rw-r--r-- | tests/tcos.c | 16 | ||||
-rw-r--r-- | tests/tcot.c | 10 | ||||
-rw-r--r-- | tests/tcoth.c | 10 | ||||
-rw-r--r-- | tests/tdiv.c | 18 | ||||
-rw-r--r-- | tests/tdiv_ui.c | 8 | ||||
-rw-r--r-- | tests/teq.c | 4 | ||||
-rw-r--r-- | tests/tests.c | 6 | ||||
-rw-r--r-- | tests/texceptions.c | 18 | ||||
-rw-r--r-- | tests/texp.c | 28 | ||||
-rw-r--r-- | tests/texp10.c | 12 | ||||
-rw-r--r-- | tests/texp2.c | 12 | ||||
-rw-r--r-- | tests/texpm1.c | 2 | ||||
-rw-r--r-- | tests/tfactorial.c | 30 | ||||
-rw-r--r-- | tests/tfma.c | 38 | ||||
-rw-r--r-- | tests/tfmod.c | 6 | ||||
-rw-r--r-- | tests/tfms.c | 38 | ||||
-rw-r--r-- | tests/tfprintf.c | 4 | ||||
-rw-r--r-- | tests/tfrac.c | 10 | ||||
-rw-r--r-- | tests/tgeneric.c | 2 | ||||
-rw-r--r-- | tests/tgeneric_ui.c | 2 | ||||
-rw-r--r-- | tests/tget_d.c | 2 | ||||
-rw-r--r-- | tests/tget_d_2exp.c | 2 | ||||
-rw-r--r-- | tests/tget_ld_2exp.c | 2 | ||||
-rw-r--r-- | tests/tget_sj.c | 8 | ||||
-rw-r--r-- | tests/tget_str.c | 8 | ||||
-rw-r--r-- | tests/tgmpop.c | 32 | ||||
-rw-r--r-- | tests/thypot.c | 10 | ||||
-rw-r--r-- | tests/tinternals.c | 6 | ||||
-rw-r--r-- | tests/tlgamma.c | 4 | ||||
-rw-r--r-- | tests/tlog.c | 8 | ||||
-rw-r--r-- | tests/tlog10.c | 2 | ||||
-rw-r--r-- | tests/tlog1p.c | 2 | ||||
-rw-r--r-- | tests/tmodf.c | 2 | ||||
-rw-r--r-- | tests/tmul.c | 12 | ||||
-rw-r--r-- | tests/tmul_2exp.c | 2 | ||||
-rw-r--r-- | tests/tmul_ui.c | 4 | ||||
-rw-r--r-- | tests/tout_str.c | 4 | ||||
-rw-r--r-- | tests/toutimpl.c | 2 | ||||
-rw-r--r-- | tests/tpow.c | 20 | ||||
-rw-r--r-- | tests/tpow3.c | 2 | ||||
-rw-r--r-- | tests/tpow_all.c | 46 | ||||
-rw-r--r-- | tests/tpow_z.c | 2 | ||||
-rw-r--r-- | tests/tprintf.c | 6 | ||||
-rw-r--r-- | tests/trec_sqrt.c | 2 | ||||
-rw-r--r-- | tests/trint.c | 28 | ||||
-rw-r--r-- | tests/troot.c | 10 | ||||
-rw-r--r-- | tests/tsec.c | 12 | ||||
-rw-r--r-- | tests/tsech.c | 12 | ||||
-rw-r--r-- | tests/tset.c | 2 | ||||
-rw-r--r-- | tests/tset_d.c | 10 | ||||
-rw-r--r-- | tests/tset_f.c | 4 | ||||
-rw-r--r-- | tests/tset_ld.c | 4 | ||||
-rw-r--r-- | tests/tset_q.c | 6 | ||||
-rw-r--r-- | tests/tset_si.c | 20 | ||||
-rw-r--r-- | tests/tset_str.c | 4 | ||||
-rw-r--r-- | tests/tset_z.c | 6 | ||||
-rw-r--r-- | tests/tsin.c | 6 | ||||
-rw-r--r-- | tests/tsin_cos.c | 20 | ||||
-rw-r--r-- | tests/tsinh_cosh.c | 2 | ||||
-rw-r--r-- | tests/tsprintf.c | 2 | ||||
-rw-r--r-- | tests/tsqr.c | 12 | ||||
-rw-r--r-- | tests/tsqrt.c | 14 | ||||
-rw-r--r-- | tests/tsqrt_ui.c | 2 | ||||
-rw-r--r-- | tests/tsub.c | 6 | ||||
-rw-r--r-- | tests/tsub1sp.c | 132 | ||||
-rw-r--r-- | tests/tsub_ui.c | 4 | ||||
-rw-r--r-- | tests/tsubnormal.c | 2 | ||||
-rw-r--r-- | tests/tsum.c | 10 | ||||
-rw-r--r-- | tests/tui_div.c | 10 | ||||
-rw-r--r-- | tests/tui_pow.c | 4 | ||||
-rw-r--r-- | tests/tui_sub.c | 8 | ||||
-rw-r--r-- | tests/tzeta.c | 4 | ||||
-rw-r--r-- | tests/tzeta_ui.c | 8 | ||||
-rw-r--r-- | ui_div.c | 4 | ||||
-rw-r--r-- | ui_pow.c | 2 | ||||
-rw-r--r-- | ui_pow_ui.c | 2 | ||||
-rw-r--r-- | ui_sub.c | 2 | ||||
-rw-r--r-- | vasprintf.c | 2 | ||||
-rw-r--r-- | yn.c | 8 | ||||
-rw-r--r-- | zeta.c | 4 | ||||
-rw-r--r-- | zeta_ui.c | 2 |
233 files changed, 1021 insertions, 1019 deletions
@@ -25,6 +25,8 @@ 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 + compatibility). - 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 8c59e8dda..8ad33eeaf 100644 --- a/README.dev +++ b/README.dev @@ -454,7 +454,7 @@ after the format string. +++ MPFR_LOG_BEGIN(x) Add this macro at the beginning of a function. Example: - int dodo (mpfr_t x, mpfr_t op, int cnt, mp_rnd_t rnd) { + int dodo (mpfr_t x, mpfr_t op, int cnt, mpfr_rnd_t rnd) { [decl] MPFR_LOG_BEGIN (("op[%#R]=%R rnd=%s", op, op, RND2STR(rnd))); @@ -506,7 +506,7 @@ could use theses macros: If you plan to add a new function, you could follow this schema: int -mpfr_toto (mpfr_ptr rop, mpfr_srcptr op, mp_rnd_t rnd) +mpfr_toto (mpfr_ptr rop, mpfr_srcptr op, mpfr_rnd_t rnd) { [Declare all used variables] int inexact; @@ -213,7 +213,7 @@ Table of contents: - radians - sqrtpi -- mpfr_frexp(mpfr_t rop, mp_exp_t *n, mpfr_t op, mp_rnd_t rnd) suggested by +- mpfr_frexp(mpfr_t rop, mp_exp_t *n, mpfr_t op, mpfr_rnd_t rnd) suggested by Steve Kargl <sgk@troutmask.apl.washington.edu> Sun, 7 Aug 2005 - mpfr_inp_raw, mpfr_out_raw (cf mail "Serialization of mpfr_t" from Alexey and answer from Granlund on mpfr list, May 2007) @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_acos (mpfr_ptr acos, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_acos (mpfr_ptr acos, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t xp, arcc, tmp; mp_exp_t supplement; @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., * acosh= ln(x + sqrt(x^2-1)) */ int -mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mp_rnd_t rnd_mode) +mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mpfr_rnd_t rnd_mode) { MPFR_SAVE_EXPO_DECL (expo); int inexact; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { MPFR_LOG_FUNC (("b[%#R]=%R c[%#R]=%R rnd=%d", b, b, c, c, rnd_mode), ("a[%#R]=%R", a, a)); @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* compute sign(b) * (|b| + |c|), assuming b and c have same sign, and are not NaN, Inf, nor zero. */ int -mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +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; @@ -28,8 +28,8 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef WANT_ASSERT # if WANT_ASSERT >= 2 -int mpfr_add1sp2 (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mp_rnd_t); -int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +int mpfr_add1sp2 (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t); +int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mpfr_t tmpa, tmpb, tmpc; int inexb, inexc, inexact, inexact2; @@ -84,7 +84,7 @@ int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) a negative value when the result is less than the exact value, a positive value otherwise. */ int -mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mp_exp_unsigned_t d; mp_prec_t p; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_add_d (mpfr_ptr a, mpfr_srcptr b, double c, mp_rnd_t rnd_mode) +mpfr_add_d (mpfr_ptr a, mpfr_srcptr b, double c, mpfr_rnd_t rnd_mode) { int inexact; mpfr_t d; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_add_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) +mpfr_add_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode) { if (MPFR_LIKELY(u != 0) ) /* if u=0, do nothing */ { @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* agm(x,y) is between x and y, so we don't need to save exponent range */ int -mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mp_rnd_t rnd_mode) +mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) { int compare, inexact; mp_size_t s; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_asin (mpfr_ptr asin, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_asin (mpfr_ptr asin, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t xp; int compared, inexact; @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., * asinh = ln(x + sqrt(x^2 + 1)) */ int -mpfr_asinh (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_asinh (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { int inexact; int signx, neg; @@ -184,7 +184,7 @@ mpfr_atan_aux (mpfr_ptr y, mpz_ptr p, long r, int m, mpz_t *tab) } int -mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t xp, arctgt, sk, tmp, tmp2; mpz_t ukz; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_atan2 (mpfr_ptr dest, mpfr_srcptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_atan2 (mpfr_ptr dest, mpfr_srcptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t tmp, pi; int inexact; @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., atanh= 1/2*ln(x+1)-1/2*ln(1-x) */ int -mpfr_atanh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode) +mpfr_atanh (mpfr_ptr y, mpfr_srcptr xt , mpfr_rnd_t rnd_mode) { int inexact; mpfr_t x, t, te; @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., useful if some user wants to add a new constant to mpfr, and implement a cache mechanism for that constant */ void -mpfr_init_cache (mpfr_cache_t cache, int (*func)(mpfr_ptr, mp_rnd_t)) +mpfr_init_cache (mpfr_cache_t cache, int (*func)(mpfr_ptr, mpfr_rnd_t)) { MPFR_PREC (cache->x) = 0; /* Invalid prec to detect that the cache is not valid. Maybe add a flag? */ @@ -43,7 +43,7 @@ mpfr_clear_cache (mpfr_cache_t cache) } int -mpfr_cache (mpfr_ptr dest, mpfr_cache_t cache, mp_rnd_t rnd) +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); @@ -42,7 +42,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpz_t m; mp_exp_t e, r, sh; diff --git a/const_catalan.c b/const_catalan.c index 33ad224ec..14ed03252 100644 --- a/const_catalan.c +++ b/const_catalan.c @@ -29,7 +29,7 @@ MPFR_DECL_INIT_CACHE(__gmpfr_cache_const_catalan, mpfr_const_catalan_internal); /* Set User Interface */ #undef mpfr_const_catalan int -mpfr_const_catalan (mpfr_ptr x, mp_rnd_t rnd_mode) { +mpfr_const_catalan (mpfr_ptr x, mpfr_rnd_t rnd_mode) { return mpfr_cache (x, __gmpfr_cache_const_catalan, rnd_mode); } @@ -82,7 +82,7 @@ S (mpz_t T, mpz_t P, mpz_t Q, unsigned long n1, unsigned long n2) G = Pi/8*log(2+sqrt(3)) + 3/8*sum(k!^2/(2k)!/(2k+1)^2,k=0..infinity) */ int -mpfr_const_catalan_internal (mpfr_ptr g, mp_rnd_t rnd_mode) +mpfr_const_catalan_internal (mpfr_ptr g, mpfr_rnd_t rnd_mode) { mpfr_t x, y, z; mpz_t T, P, Q; diff --git a/const_euler.c b/const_euler.c index cfb7871cc..897c2b102 100644 --- a/const_euler.c +++ b/const_euler.c @@ -29,7 +29,7 @@ MPFR_DECL_INIT_CACHE(__gmpfr_cache_const_euler, mpfr_const_euler_internal); /* Set User Interface */ #undef mpfr_const_euler int -mpfr_const_euler (mpfr_ptr x, mp_rnd_t rnd_mode) { +mpfr_const_euler (mpfr_ptr x, mpfr_rnd_t rnd_mode) { return mpfr_cache (x, __gmpfr_cache_const_euler, rnd_mode); } @@ -38,7 +38,7 @@ static void mpfr_const_euler_S2 (mpfr_ptr, unsigned long); static void mpfr_const_euler_R (mpfr_ptr, unsigned long); int -mpfr_const_euler_internal (mpfr_t x, mp_rnd_t rnd) +mpfr_const_euler_internal (mpfr_t x, mpfr_rnd_t rnd) { mp_prec_t prec = MPFR_PREC(x), m, log2m; mpfr_t y, z; diff --git a/const_log2.c b/const_log2.c index 19f1a2a11..588139e2f 100644 --- a/const_log2.c +++ b/const_log2.c @@ -29,7 +29,7 @@ MPFR_DECL_INIT_CACHE(__gmpfr_cache_const_log2, mpfr_const_log2_internal); /* Set User interface */ #undef mpfr_const_log2 int -mpfr_const_log2 (mpfr_ptr x, mp_rnd_t rnd_mode) { +mpfr_const_log2 (mpfr_ptr x, mpfr_rnd_t rnd_mode) { return mpfr_cache (x, __gmpfr_cache_const_log2, rnd_mode); } @@ -103,7 +103,7 @@ S (mpz_t *T, mpz_t *P, mpz_t *Q, unsigned long n1, unsigned long n2, int need_P) /* Don't need to save / restore exponent range: the cache does it */ int -mpfr_const_log2_internal (mpfr_ptr x, mp_rnd_t rnd_mode) +mpfr_const_log2_internal (mpfr_ptr x, mpfr_rnd_t rnd_mode) { unsigned long n = MPFR_PREC (x); mp_prec_t w; /* working precision */ diff --git a/const_pi.c b/const_pi.c index e59e07215..42644ee20 100644 --- a/const_pi.c +++ b/const_pi.c @@ -28,13 +28,13 @@ MPFR_DECL_INIT_CACHE(__gmpfr_cache_const_pi, mpfr_const_pi_internal); /* Set User Interface */ #undef mpfr_const_pi int -mpfr_const_pi (mpfr_ptr x, mp_rnd_t rnd_mode) { +mpfr_const_pi (mpfr_ptr x, mpfr_rnd_t rnd_mode) { return mpfr_cache (x, __gmpfr_cache_const_pi, rnd_mode); } /* Don't need to save/restore exponent range: the cache does it */ int -mpfr_const_pi_internal (mpfr_ptr x, mp_rnd_t rnd_mode) +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; diff --git a/copysign.c b/copysign.c index be06e1df3..a0f70bc30 100644 --- a/copysign.c +++ b/copysign.c @@ -32,7 +32,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #undef mpfr_copysign int -mpfr_copysign (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode) +mpfr_copysign (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) { return mpfr_set4 (z, x, rnd_mode, MPFR_SIGN (y)); } @@ -118,7 +118,7 @@ mpfr_cos2_aux (mpfr_ptr f, mpfr_srcptr r) } int -mpfr_cos (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_cos (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mp_prec_t K0, K, precy, m, k, l; int inexact, reduce = 0; @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., * cosh= 1/2[e^(x)+e^(-x)] */ int -mpfr_cosh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode) +mpfr_cosh (mpfr_ptr y, mpfr_srcptr xt , mpfr_rnd_t rnd_mode) { mpfr_t x; int inexact; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_d_div (mpfr_ptr a, double b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_d_div (mpfr_ptr a, double b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int inexact; mpfr_t d; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_d_sub (mpfr_ptr a, double b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_d_sub (mpfr_ptr a, double b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int inexact; mpfr_t d; @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_dim (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode) +mpfr_dim (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) { if (MPFR_IS_NAN(x) || MPFR_IS_NAN(y)) { @@ -129,7 +129,7 @@ mpfr_mpn_sub_aux (mp_ptr ap, mp_ptr bp, mp_size_t n, mp_limb_t cy, int extra) } int -mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mp_rnd_t rnd_mode) +mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode) { mp_size_t q0size = MPFR_LIMB_SIZE(q); /* number of limbs of destination */ mp_size_t usize = MPFR_LIMB_SIZE(u); diff --git a/div_2exp.c b/div_2exp.c index 442afe59c..d1f112965 100644 --- a/div_2exp.c +++ b/div_2exp.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #undef mpfr_div_2exp int -mpfr_div_2exp (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mp_rnd_t rnd_mode) +mpfr_div_2exp (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mpfr_rnd_t rnd_mode) { return mpfr_div_2ui (y, x, n, rnd_mode); } @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_div_2si (mpfr_ptr y, mpfr_srcptr x, long int n, mp_rnd_t rnd_mode) +mpfr_div_2si (mpfr_ptr y, mpfr_srcptr x, long int n, mpfr_rnd_t rnd_mode) { int inexact; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_div_2ui (mpfr_ptr y, mpfr_srcptr x, unsigned long n, mp_rnd_t rnd_mode) +mpfr_div_2ui (mpfr_ptr y, mpfr_srcptr x, unsigned long n, mpfr_rnd_t rnd_mode) { int inexact; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_div_d (mpfr_ptr a, mpfr_srcptr b, double c, mp_rnd_t rnd_mode) +mpfr_div_d (mpfr_ptr a, mpfr_srcptr b, double c, mpfr_rnd_t rnd_mode) { int inexact; mpfr_t d; @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* returns 0 if result exact, non-zero otherwise */ int -mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) +mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode) { long i; int sh; @@ -252,7 +252,7 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) return mpfr_check_range (y, inexact, rnd_mode); } -int mpfr_div_si (mpfr_ptr y, mpfr_srcptr x, long int u, mp_rnd_t rnd_mode) +int mpfr_div_si (mpfr_ptr y, mpfr_srcptr x, long int u, mpfr_rnd_t rnd_mode) { int res; @@ -191,7 +191,7 @@ mpfr_eint_asympt (mpfr_ptr y, mpfr_srcptr x) } int -mpfr_eint (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd) +mpfr_eint (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) { int inex; mpfr_t tmp, ump; @@ -25,10 +25,10 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define EXP1 2.71828182845904523536 /* exp(1) */ -static int mpfr_erf_0 (mpfr_ptr, mpfr_srcptr, double, mp_rnd_t); +static int mpfr_erf_0 (mpfr_ptr, mpfr_srcptr, double, mpfr_rnd_t); int -mpfr_erf (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_erf (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t xf; int inex, large; @@ -124,7 +124,7 @@ mpfr_erf (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) if (MPFR_UNLIKELY (large)) /* |erf x| = 1 or 1- */ { - mp_rnd_t rnd2 = MPFR_IS_POS (x) ? rnd_mode : MPFR_INVERT_RND(rnd_mode); + mpfr_rnd_t rnd2 = MPFR_IS_POS (x) ? rnd_mode : MPFR_INVERT_RND(rnd_mode); if (rnd2 == MPFR_RNDN || rnd2 == MPFR_RNDU || rnd2 == MPFR_RNDA) { inex = MPFR_INT_SIGN (x); @@ -178,7 +178,7 @@ mul_2exp (double x, mp_exp_t e) Assumes also that e*x^2 <= n (target precision). */ static int -mpfr_erf_0 (mpfr_ptr res, mpfr_srcptr x, double xf2, mp_rnd_t rnd_mode) +mpfr_erf_0 (mpfr_ptr res, mpfr_srcptr x, double xf2, mpfr_rnd_t rnd_mode) { mp_prec_t n, m; mp_exp_t nuk, sigmak; @@ -121,7 +121,7 @@ mpfr_erfc_asympt (mpfr_ptr y, mpfr_srcptr x) } int -mpfr_erfc (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd) +mpfr_erfc (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) { int inex; mpfr_t tmp; diff --git a/exceptions.c b/exceptions.c index 2fd8f6406..4416ff429 100644 --- a/exceptions.c +++ b/exceptions.c @@ -191,7 +191,7 @@ mpfr_set_erangeflag (void) #undef mpfr_check_range int -mpfr_check_range (mpfr_ptr x, int t, mp_rnd_t rnd_mode) +mpfr_check_range (mpfr_ptr x, int t, mpfr_rnd_t rnd_mode) { if (MPFR_LIKELY( MPFR_IS_PURE_FP(x)) ) { /* x is a non-zero FP */ @@ -288,7 +288,7 @@ mpfr_erangeflag_p (void) is <= 2^(emin-2) in absolute value. */ int -mpfr_underflow (mpfr_ptr x, mp_rnd_t rnd_mode, int sign) +mpfr_underflow (mpfr_ptr x, mpfr_rnd_t rnd_mode, int sign) { int inex; @@ -312,7 +312,7 @@ mpfr_underflow (mpfr_ptr x, mp_rnd_t rnd_mode, int sign) /* #undef mpfr_overflow */ int -mpfr_overflow (mpfr_ptr x, mp_rnd_t rnd_mode, int sign) +mpfr_overflow (mpfr_ptr x, mpfr_rnd_t rnd_mode, int sign) { int inex; @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* #define DEBUG */ int -mpfr_exp (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_exp (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mp_exp_t expx; mp_prec_t precy; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_exp10 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_exp10 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { return mpfr_ui_pow (y, 10, x, rnd_mode); } @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., * y = exp(z*log(2)). The result is exact iff z is an integer. */ int -mpfr_exp2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_exp2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { int inexact; long xint; @@ -62,7 +62,7 @@ mpfr_exp2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) MPFR_ASSERTN (MPFR_EMIN_MIN >= LONG_MIN + 2); if (MPFR_UNLIKELY (mpfr_cmp_si (x, __gmpfr_emin - 1) < 0)) { - mp_rnd_t rnd2 = rnd_mode; + mpfr_rnd_t rnd2 = rnd_mode; /* in round to nearest mode, round to zero when x <= __gmpfr_emin-2 */ if (rnd_mode == MPFR_RNDN && mpfr_cmp_si_2exp (x, __gmpfr_emin - 2, 0) <= 0) @@ -150,7 +150,7 @@ mpfr_exp_rational (mpfr_ptr y, mpz_ptr p, long r, int m, #define shift (BITS_PER_MP_LIMB/2) int -mpfr_exp_3 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_exp_3 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t t, x_copy, tmp; mpz_t uk; @@ -80,7 +80,7 @@ mpz_normalize2 (mpz_t rop, mpz_t z, mp_exp_t expz, mp_exp_t target) This function returns with the exact flags due to exp. */ int -mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { long n; unsigned long K, k, l, err; /* FIXME: Which type ? */ @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_expm1 (mpfr_ptr y, mpfr_srcptr x , mp_rnd_t rnd_mode) +mpfr_expm1 (mpfr_ptr y, mpfr_srcptr x , mpfr_rnd_t rnd_mode) { int inexact; mp_exp_t ex; diff --git a/factorial.c b/factorial.c index 86a35781a..e6b416109 100644 --- a/factorial.c +++ b/factorial.c @@ -31,7 +31,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* FIXME: efficient problems with large arguments; see comments in gamma.c. */ int -mpfr_fac_ui (mpfr_ptr y, unsigned long int x, mp_rnd_t rnd_mode) +mpfr_fac_ui (mpfr_ptr y, unsigned long int x, mpfr_rnd_t rnd_mode) { mpfr_t t; /* Variable of Intermediary Calculation*/ unsigned long i; @@ -41,7 +41,7 @@ mpfr_fac_ui (mpfr_ptr y, unsigned long int x, mp_rnd_t rnd_mode) mp_prec_t Nt; /* Precision of Intermediary Calculation variable */ mp_prec_t err; /* Precision of error */ - mp_rnd_t rnd; + mpfr_rnd_t rnd; MPFR_SAVE_EXPO_DECL (expo); MPFR_ZIV_DECL (loop); diff --git a/fits_intmax.c b/fits_intmax.c index b930ccff7..0e1a0d615 100644 --- a/fits_intmax.c +++ b/fits_intmax.c @@ -45,7 +45,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* We can't use fits_s.h <= mpfr_cmp_ui */ int -mpfr_fits_intmax_p (mpfr_srcptr f, mp_rnd_t rnd) +mpfr_fits_intmax_p (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_exp_t exp; mp_prec_t prec; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -FUNCTION (mpfr_srcptr f, mp_rnd_t rnd) +FUNCTION (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_exp_t exp; mp_prec_t prec; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -FUNCTION (mpfr_srcptr f, mp_rnd_t rnd) +FUNCTION (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_exp_t exp; mp_prec_t prec; diff --git a/fits_uintmax.c b/fits_uintmax.c index 0d4b20e04..d99f0cf1c 100644 --- a/fits_uintmax.c +++ b/fits_uintmax.c @@ -45,7 +45,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* We can't use fits_u.h <= mpfr_cmp_ui */ int -mpfr_fits_uintmax_p (mpfr_srcptr f, mp_rnd_t rnd) +mpfr_fits_uintmax_p (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_exp_t exp; mp_prec_t prec; @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int mpfr_fma (mpfr_ptr s, mpfr_srcptr x, mpfr_srcptr y, mpfr_srcptr z, - mp_rnd_t rnd_mode) + mpfr_rnd_t rnd_mode) { int inexact; mpfr_t u; @@ -30,7 +30,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int mpfr_fms (mpfr_ptr s, mpfr_srcptr x, mpfr_srcptr y, mpfr_srcptr z, - mp_rnd_t rnd_mode) + mpfr_rnd_t rnd_mode) { int inexact; mpfr_t u; @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., as some cases will take longer (the number may be parsed twice). */ int -mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode) +mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) { mp_exp_t re, ue; mp_prec_t uq; @@ -95,7 +95,7 @@ bits_fac (unsigned long n) i.e. with x = 1-t, then Gamma(x) = -Pi*(1-x)/sin(Pi*(2-x))/GAMMA(2-x) */ int -mpfr_gamma (mpfr_ptr gamma, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_gamma (mpfr_ptr gamma, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t xp, GammaTrial, tmp, tmp2; mpz_t fact; diff --git a/gen_inverse.h b/gen_inverse.h index a23ab61aa..ff10458b0 100644 --- a/gen_inverse.h +++ b/gen_inverse.h @@ -41,7 +41,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -FUNCTION (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +FUNCTION (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mp_prec_t precy; /* target precision */ mp_prec_t m; /* working precision */ @@ -151,7 +151,7 @@ mpfr_scale2 (double d, int exp) such as NaN must be avoided if not supported). */ double -mpfr_get_d (mpfr_srcptr src, mp_rnd_t rnd_mode) +mpfr_get_d (mpfr_srcptr src, mpfr_rnd_t rnd_mode) { double d; int negative; @@ -246,7 +246,7 @@ mpfr_get_d1 (mpfr_srcptr src) } double -mpfr_get_d_2exp (long *expptr, mpfr_srcptr src, mp_rnd_t rnd_mode) +mpfr_get_d_2exp (long *expptr, mpfr_srcptr src, mpfr_rnd_t rnd_mode) { double ret; mp_exp_t exp; @@ -294,7 +294,7 @@ string_to_Decimal64 (char *s) } _Decimal64 -mpfr_get_decimal64 (mpfr_srcptr src, mp_rnd_t rnd_mode) +mpfr_get_decimal64 (mpfr_srcptr src, mpfr_rnd_t rnd_mode) { int negative; mp_exp_t e; @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., (y is NaN, +Inf, or -Inf that have no equivalent in mpf) */ int -mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mp_rnd_t rnd_mode) +mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) { int inex; mp_size_t sx, sy; @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifndef HAVE_LDOUBLE_IEEE_EXT_LITTLE long double -mpfr_get_ld (mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_get_ld (mpfr_srcptr x, mpfr_rnd_t rnd_mode) { if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x))) @@ -103,7 +103,7 @@ mpfr_get_ld (mpfr_srcptr x, mp_rnd_t rnd_mode) #else long double -mpfr_get_ld (mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_get_ld (mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_long_double_t ld; mpfr_t tmp; @@ -171,7 +171,7 @@ mpfr_get_ld (mpfr_srcptr x, mp_rnd_t rnd_mode) /* contributed by Damien Stehle */ long double -mpfr_get_ld_2exp (long *expptr, mpfr_srcptr src, mp_rnd_t rnd_mode) +mpfr_get_ld_2exp (long *expptr, mpfr_srcptr src, mpfr_rnd_t rnd_mode) { long double ret; mp_exp_t exp; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" long -mpfr_get_si (mpfr_srcptr f, mp_rnd_t rnd) +mpfr_get_si (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_prec_t prec; long s; @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" static int mpfr_get_str_aux (char *const, mp_exp_t *const, mp_limb_t *const, - mp_size_t, mp_exp_t, long, int, size_t, mp_rnd_t); + mp_size_t, mp_exp_t, long, int, size_t, mpfr_rnd_t); /* The implicit \0 is useless, but we do not write num_to_text[62] otherwise g++ complains. */ @@ -75,7 +75,7 @@ static const char num_to_text62[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" static int mpfr_get_str_aux (char *const str, mp_exp_t *const exp, mp_limb_t *const r, mp_size_t n, mp_exp_t f, long e, int b, size_t m, - mp_rnd_t rnd) + mpfr_rnd_t rnd) { const char *num_to_text; int dir; /* direction of the rounded result */ @@ -83,7 +83,7 @@ mpfr_get_str_aux (char *const str, mp_exp_t *const exp, mp_limb_t *const r, mp_size_t i0, j0; /* number of limbs and bits of Y */ unsigned char *str1; /* string of m+2 characters */ size_t size_s1; /* length of str1 */ - mp_rnd_t rnd1; + mpfr_rnd_t rnd1; size_t i; int exact = (e < 0); MPFR_TMP_DECL(marker); @@ -2234,7 +2234,7 @@ ceil_mul (mp_exp_t e, int beta, int i) the memory space allocated, with free(s, strlen(s)). */ char* -mpfr_get_str (char *s, mp_exp_t *e, int b, size_t m, mpfr_srcptr x, mp_rnd_t rnd) +mpfr_get_str (char *s, mp_exp_t *e, int b, size_t m, mpfr_srcptr x, mpfr_rnd_t rnd) { const char *num_to_text; int exact; /* exact result */ @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" unsigned long -mpfr_get_ui (mpfr_srcptr f, mp_rnd_t rnd) +mpfr_get_ui (mpfr_srcptr f, mpfr_rnd_t rnd) { mp_prec_t prec; unsigned long s; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_get_z (mpz_ptr z, mpfr_srcptr f, mp_rnd_t rnd) +mpfr_get_z (mpz_ptr z, mpfr_srcptr f, mpfr_rnd_t rnd) { int inex; mpfr_t r; @@ -42,8 +42,8 @@ init_set_z (mpfr_ptr t, mpz_srcptr z) /* Init, set a mpfr_t with enough precision to store a mpz_t without round, call the function, and clear the allocated mpfr_t */ static int -foo (mpfr_ptr x, mpfr_srcptr y, mpz_srcptr z, mp_rnd_t r, - int (*f)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mp_rnd_t)) +foo (mpfr_ptr x, mpfr_srcptr y, mpz_srcptr z, mpfr_rnd_t r, + int (*f)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t)) { mpfr_t t; int i; @@ -54,19 +54,19 @@ foo (mpfr_ptr x, mpfr_srcptr y, mpz_srcptr z, mp_rnd_t r, } int -mpfr_mul_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t r) +mpfr_mul_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t r) { return foo (y, x, z, r, mpfr_mul); } int -mpfr_div_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t r) +mpfr_div_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t r) { return foo (y, x, z, r, mpfr_div); } int -mpfr_add_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t r) +mpfr_add_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t r) { /* Mpz 0 is unsigned */ if (MPFR_UNLIKELY (mpz_sgn (z) == 0)) @@ -76,7 +76,7 @@ mpfr_add_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t r) } int -mpfr_sub_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t r) +mpfr_sub_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t r) { /* Mpz 0 is unsigned */ if (MPFR_UNLIKELY (mpz_sgn (z) == 0)) @@ -97,7 +97,7 @@ mpfr_cmp_z (mpfr_srcptr x, mpz_srcptr z) } int -mpfr_mul_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mp_rnd_t rnd_mode) +mpfr_mul_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mpfr_rnd_t rnd_mode) { mpfr_t tmp; int res; @@ -118,7 +118,7 @@ mpfr_mul_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mp_rnd_t rnd_mode) } int -mpfr_div_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mp_rnd_t rnd_mode) +mpfr_div_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mpfr_rnd_t rnd_mode) { mpfr_t tmp; int res; @@ -139,7 +139,7 @@ mpfr_div_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mp_rnd_t rnd_mode) } int -mpfr_add_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mp_rnd_t rnd_mode) +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; @@ -212,7 +212,7 @@ mpfr_add_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mp_rnd_t rnd_mode) } int -mpfr_sub_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z,mp_rnd_t rnd_mode) +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; @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., * hypot(x,y)= sqrt(x^2+y^2) = z */ int -mpfr_hypot (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode) +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 */ @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" size_t -mpfr_inp_str (mpfr_ptr rop, FILE *stream, int base, mp_rnd_t rnd_mode) +mpfr_inp_str (mpfr_ptr rop, FILE *stream, int base, mpfr_rnd_t rnd_mode) { unsigned char *str; size_t alloc_size, str_size; @@ -28,16 +28,16 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., j(n,-z) = (-1)^n j(n,z) */ -static int mpfr_jn_asympt (mpfr_ptr, long, mpfr_srcptr, mp_rnd_t); +static int mpfr_jn_asympt (mpfr_ptr, long, mpfr_srcptr, mpfr_rnd_t); int -mpfr_j0 (mpfr_ptr res, mpfr_srcptr z, mp_rnd_t r) +mpfr_j0 (mpfr_ptr res, mpfr_srcptr z, mpfr_rnd_t r) { return mpfr_jn (res, 0, z, r); } int -mpfr_j1 (mpfr_ptr res, mpfr_srcptr z, mp_rnd_t r) +mpfr_j1 (mpfr_ptr res, mpfr_srcptr z, mpfr_rnd_t r) { return mpfr_jn (res, 1, z, r); } @@ -73,7 +73,7 @@ mpfr_jn_k0 (long n, mpfr_srcptr z) } int -mpfr_jn (mpfr_ptr res, long n, mpfr_srcptr z, mp_rnd_t r) +mpfr_jn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r) { int inex; unsigned long absn; diff --git a/jyn_asympt.c b/jyn_asympt.c index ba6a198e6..fcae090d4 100644 --- a/jyn_asympt.c +++ b/jyn_asympt.c @@ -38,7 +38,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., flag should not happen for normal input). */ static int -FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mp_rnd_t r) +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; @@ -152,7 +152,7 @@ unit_bit (mpfr_srcptr (x)) #endif static int -GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mp_rnd_t rnd) +GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mpfr_rnd_t rnd) { mp_prec_t precy, w; /* working precision */ mpfr_t s, t, u, v, z; @@ -557,7 +557,7 @@ GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mp_rnd_t rnd) #ifndef IS_GAMMA int -mpfr_lngamma (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd) +mpfr_lngamma (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) { int inex; @@ -592,7 +592,7 @@ mpfr_lngamma (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd) } int -mpfr_lgamma (mpfr_ptr y, int *signp, mpfr_srcptr x, mp_rnd_t rnd) +mpfr_lgamma (mpfr_ptr y, int *signp, mpfr_srcptr x, mpfr_rnd_t rnd) { int inex; @@ -39,7 +39,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_log (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode) +mpfr_log (mpfr_ptr r, mpfr_srcptr a, mpfr_rnd_t rnd_mode) { int inexact; mp_prec_t p, q; @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_log10 (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode) +mpfr_log10 (mpfr_ptr r, mpfr_srcptr a, mpfr_rnd_t rnd_mode) { int inexact; MPFR_SAVE_EXPO_DECL (expo); @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., log1p(x)=log(1+x) */ int -mpfr_log1p (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_log1p (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { int comp, inexact; mp_exp_t ex; @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., r=log2(a)=log(a)/log(2) */ int -mpfr_log2 (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode) +mpfr_log2 (mpfr_ptr r, mpfr_srcptr a, mpfr_rnd_t rnd_mode) { int inexact; MPFR_SAVE_EXPO_DECL (expo); @@ -30,7 +30,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_min (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode) +mpfr_min (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) { if (MPFR_ARE_SINGULAR(x,y)) { @@ -64,7 +64,7 @@ mpfr_min (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode) */ int -mpfr_max (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode) +mpfr_max (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) { if (MPFR_ARE_SINGULAR(x,y)) { diff --git a/mpfr-impl.h b/mpfr-impl.h index 03403c543..654b54a9d 100644 --- a/mpfr-impl.h +++ b/mpfr-impl.h @@ -1578,19 +1578,19 @@ struct mpfr_group_t { extern "C" { #endif -__MPFR_DECLSPEC int mpfr_underflow _MPFR_PROTO ((mpfr_ptr, mp_rnd_t, int)); -__MPFR_DECLSPEC int mpfr_overflow _MPFR_PROTO ((mpfr_ptr, mp_rnd_t, int)); +__MPFR_DECLSPEC int mpfr_underflow _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t, int)); +__MPFR_DECLSPEC int mpfr_overflow _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t, int)); __MPFR_DECLSPEC int mpfr_add1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, - mpfr_srcptr, mp_rnd_t)); + mpfr_srcptr, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_sub1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, - mpfr_srcptr, mp_rnd_t)); + mpfr_srcptr, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_add1sp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, - mpfr_srcptr, mp_rnd_t)); + mpfr_srcptr, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_sub1sp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, - mpfr_srcptr, mp_rnd_t)); + 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, mp_rnd_t, mp_rnd_t, mp_prec_t)); + mp_size_t, int, mp_exp_t, mpfr_rnd_t, mpfr_rnd_t, mp_prec_t)); __MPFR_DECLSPEC int mpfr_cmp2 _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr, mp_prec_t *)); @@ -1602,12 +1602,12 @@ __MPFR_DECLSPEC unsigned long __gmpfr_isqrt _MPFR_PROTO ((unsigned long)); __MPFR_DECLSPEC unsigned long __gmpfr_cuberoot _MPFR_PROTO ((unsigned long)); __MPFR_DECLSPEC int __gmpfr_int_ceil_log2 _MPFR_PROTO ((unsigned long)); -__MPFR_DECLSPEC int mpfr_exp_2 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mp_rnd_t)); -__MPFR_DECLSPEC int mpfr_exp_3 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mp_rnd_t)); +__MPFR_DECLSPEC int mpfr_exp_2 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); +__MPFR_DECLSPEC int mpfr_exp_3 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_powerof2_raw _MPFR_PROTO ((mpfr_srcptr)); __MPFR_DECLSPEC int mpfr_pow_general _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, - mpfr_srcptr, mp_rnd_t, int, mpfr_save_expo_t *)); + mpfr_srcptr, mpfr_rnd_t, int, mpfr_save_expo_t *)); __MPFR_DECLSPEC void mpfr_setmax _MPFR_PROTO ((mpfr_ptr, mp_exp_t)); __MPFR_DECLSPEC void mpfr_setmin _MPFR_PROTO ((mpfr_ptr, mp_exp_t)); @@ -1624,13 +1624,13 @@ __MPFR_DECLSPEC void mpfr_print_mant_binary _MPFR_PROTO ((const char*, __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, mp_rnd_t, int *)); + const mp_limb_t *, mp_prec_t, int, mp_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, mp_rnd_t)); + mp_prec_t, int, mp_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, mp_rnd_t, int *)); + mp_prec_t, int, mp_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, mp_rnd_t)); + const mp_limb_t *, mp_prec_t, int, mp_prec_t, mpfr_rnd_t)); #define mpfr_round_raw2(xp, xn, neg, r, prec) \ mpfr_round_raw_2((xp),(xn)*BITS_PER_MP_LIMB,(neg),(prec),(r)) @@ -1645,10 +1645,10 @@ __MPFR_DECLSPEC int mpfr_get_cputime _MPFR_PROTO ((void)); __MPFR_DECLSPEC void mpfr_nexttozero _MPFR_PROTO ((mpfr_ptr)); __MPFR_DECLSPEC void mpfr_nexttoinf _MPFR_PROTO ((mpfr_ptr)); -__MPFR_DECLSPEC int mpfr_const_pi_internal _MPFR_PROTO ((mpfr_ptr,mp_rnd_t)); -__MPFR_DECLSPEC int mpfr_const_log2_internal _MPFR_PROTO((mpfr_ptr,mp_rnd_t)); -__MPFR_DECLSPEC int mpfr_const_euler_internal _MPFR_PROTO((mpfr_ptr, mp_rnd_t)); -__MPFR_DECLSPEC int mpfr_const_catalan_internal _MPFR_PROTO((mpfr_ptr, mp_rnd_t)); +__MPFR_DECLSPEC int mpfr_const_pi_internal _MPFR_PROTO ((mpfr_ptr,mpfr_rnd_t)); +__MPFR_DECLSPEC int mpfr_const_log2_internal _MPFR_PROTO((mpfr_ptr,mpfr_rnd_t)); +__MPFR_DECLSPEC int mpfr_const_euler_internal _MPFR_PROTO((mpfr_ptr, mpfr_rnd_t)); +__MPFR_DECLSPEC int mpfr_const_catalan_internal _MPFR_PROTO((mpfr_ptr, mpfr_rnd_t)); #if 0 __MPFR_DECLSPEC void mpfr_init_cache _MPFR_PROTO ((mpfr_cache_t, @@ -1671,7 +1671,7 @@ __MPFR_DECLSPEC void mpfr_dump_mant _MPFR_PROTO ((const mp_limb_t *, __MPFR_DECLSPEC int mpfr_round_near_x _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_uexp_t, int, - mp_rnd_t)); + mpfr_rnd_t)); __MPFR_DECLSPEC void mpfr_abort_prec_max _MPFR_PROTO ((void)) MPFR_NORETURN_ATTR; @@ -228,7 +228,7 @@ __MPFR_DECLSPEC mp_exp_t mpfr_get_emax_min _MPFR_PROTO ((void)); __MPFR_DECLSPEC mp_exp_t mpfr_get_emax_max _MPFR_PROTO ((void)); __MPFR_DECLSPEC void mpfr_set_default_rounding_mode _MPFR_PROTO((mpfr_rnd_t)); -__MPFR_DECLSPEC mp_rnd_t mpfr_get_default_rounding_mode _MPFR_PROTO((void)); +__MPFR_DECLSPEC mpfr_rnd_t mpfr_get_default_rounding_mode _MPFR_PROTO((void)); __MPFR_DECLSPEC __gmp_const char * mpfr_print_rnd_mode _MPFR_PROTO((mpfr_rnd_t)); @@ -283,7 +283,7 @@ __MPFR_DECLSPEC mp_prec_t mpfr_get_default_prec _MPFR_PROTO((void)); __MPFR_DECLSPEC int mpfr_set_d _MPFR_PROTO ((mpfr_ptr, double, mpfr_rnd_t)); #ifdef MPFR_WANT_DECIMAL_FLOATS __MPFR_DECLSPEC int mpfr_set_decimal64 _MPFR_PROTO ((mpfr_ptr, _Decimal64, - mp_rnd_t)); + mpfr_rnd_t)); #endif __MPFR_DECLSPEC int mpfr_set_ld _MPFR_PROTO ((mpfr_ptr, long double, mpfr_rnd_t)); @@ -343,7 +343,7 @@ __MPFR_DECLSPEC mp_exp_t mpfr_get_z_exp _MPFR_PROTO ((mpz_ptr, mpfr_srcptr)); __MPFR_DECLSPEC double mpfr_get_d _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t)); #ifdef MPFR_WANT_DECIMAL_FLOATS __MPFR_DECLSPEC _Decimal64 mpfr_get_decimal64 _MPFR_PROTO ((mpfr_srcptr, - mp_rnd_t)); + mpfr_rnd_t)); #endif __MPFR_DECLSPEC long double mpfr_get_ld _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t)); @@ -547,11 +547,11 @@ __MPFR_DECLSPEC int mpfr_frac _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_modf _MPFR_PROTO ((mpfr_ptr, mpfr_ptr, mpfr_srcptr, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_remquo _MPFR_PROTO ((mpfr_ptr, long*, mpfr_srcptr, - mpfr_srcptr, mp_rnd_t)); + mpfr_srcptr, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_remainder _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, - mpfr_srcptr, mp_rnd_t)); + mpfr_srcptr, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_fmod _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, - mpfr_srcptr, mp_rnd_t)); + mpfr_srcptr, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_fits_ulong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_fits_slong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t)); @@ -670,7 +670,7 @@ __MPFR_DECLSPEC int mpfr_sum _MPFR_PROTO ((mpfr_ptr, mpfr_ptr *__gmp_const, __MPFR_DECLSPEC void mpfr_free_cache _MPFR_PROTO ((void)); __MPFR_DECLSPEC int mpfr_subnormalize _MPFR_PROTO ((mpfr_ptr, int, - mp_rnd_t)); + mpfr_rnd_t)); __MPFR_DECLSPEC int mpfr_strtofr _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, char **, int, mpfr_rnd_t)); @@ -571,12 +571,12 @@ may abort, crash or have undefined behavior (depending on your C implementation). @cindex Rounding Modes -@tindex @code{mp_rnd_t} +@tindex @code{mpfr_rnd_t} @noindent The @dfn{rounding mode} specifies the way to round the result of a floating-point operation, in case the exact result can not be represented exactly in the destination significand; -the corresponding C data type is @code{mp_rnd_t}. +the corresponding C data type is @code{mpfr_rnd_t}. @cindex Limb @c @tindex @code{mp_limb_t} @@ -1056,17 +1056,17 @@ number of bits used to store its significand. These functions assign new values to already initialized floats (@pxref{Initialization Functions}). -@deftypefun int mpfr_set (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_si (mpfr_t @var{rop}, long int @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_uj (mpfr_t @var{rop}, uintmax_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_sj (mpfr_t @var{rop}, intmax_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_d (mpfr_t @var{rop}, double @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_ld (mpfr_t @var{rop}, long double @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_decimal64 (mpfr_t @var{rop}, _Decimal64 @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_z (mpfr_t @var{rop}, mpz_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_q (mpfr_t @var{rop}, mpq_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_f (mpfr_t @var{rop}, mpf_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_set (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_si (mpfr_t @var{rop}, long int @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_uj (mpfr_t @var{rop}, uintmax_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_sj (mpfr_t @var{rop}, intmax_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_d (mpfr_t @var{rop}, double @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_ld (mpfr_t @var{rop}, long double @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_decimal64 (mpfr_t @var{rop}, _Decimal64 @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_z (mpfr_t @var{rop}, mpz_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_q (mpfr_t @var{rop}, mpq_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_f (mpfr_t @var{rop}, mpf_t @var{op}, mpfr_rnd_t @var{rnd}) Set the value of @var{rop} from @var{op}, rounded toward the given direction @var{rnd}. Note that the input 0 is converted to +0 by @code{mpfr_set_ui}, @@ -1094,16 +1094,16 @@ converted into a reduced-precision (e.g., 53-bit) binary number before MPFR can work with it. @end deftypefun -@deftypefun int mpfr_set_ui_2exp (mpfr_t @var{rop}, unsigned long int @var{op}, mp_exp_t @var{e}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_si_2exp (mpfr_t @var{rop}, long int @var{op}, mp_exp_t @var{e}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_uj_2exp (mpfr_t @var{rop}, uintmax_t @var{op}, intmax_t @var{e}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_set_sj_2exp (mpfr_t @var{rop}, intmax_t @var{op}, intmax_t @var{e}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_set_ui_2exp (mpfr_t @var{rop}, unsigned long int @var{op}, mp_exp_t @var{e}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_si_2exp (mpfr_t @var{rop}, long int @var{op}, mp_exp_t @var{e}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_uj_2exp (mpfr_t @var{rop}, uintmax_t @var{op}, intmax_t @var{e}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_set_sj_2exp (mpfr_t @var{rop}, intmax_t @var{op}, intmax_t @var{e}, mpfr_rnd_t @var{rnd}) Set the value of @var{rop} from @m{@var{op} \times 2^e, @var{op} multiplied by two to the power @var{e}}, rounded toward the given direction @var{rnd}. Note that the input 0 is converted to +0. @end deftypefun -@deftypefun int mpfr_set_str (mpfr_t @var{rop}, const char *@var{s}, int @var{base}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_set_str (mpfr_t @var{rop}, const char *@var{s}, int @var{base}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the value of the string @var{s} in base @var{base}, rounded in the direction @var{rnd}. See the documentation of @code{mpfr_strtofr} for a detailed description @@ -1119,7 +1119,7 @@ is a valid number in base @var{base}; otherwise it returns @minus{}1, and @var{rop} may have changed. @end deftypefun -@deftypefun int mpfr_strtofr (mpfr_t @var{rop}, const char *@var{nptr}, char **@var{endptr}, int @var{base}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_strtofr (mpfr_t @var{rop}, const char *@var{nptr}, char **@var{endptr}, int @var{base}, mpfr_rnd_t @var{rnd}) Read a floating-point number from a string @var{nptr} in base @var{base}, rounded in the direction @var{rnd}; @var{base} must be either 0 (to @@ -1200,21 +1200,21 @@ using a third auxiliary variable. @cindex Combined initialization and assignment functions @section Combined Initialization and Assignment Functions -@deftypefn Macro int mpfr_init_set (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefnx Macro int mpfr_init_set_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mp_rnd_t @var{rnd}) -@deftypefnx Macro int mpfr_init_set_si (mpfr_t @var{rop}, signed long int @var{op}, mp_rnd_t @var{rnd}) -@deftypefnx Macro int mpfr_init_set_d (mpfr_t @var{rop}, double @var{op}, mp_rnd_t @var{rnd}) -@deftypefnx Macro int mpfr_init_set_ld (mpfr_t @var{rop}, long double @var{op}, mp_rnd_t @var{rnd}) -@deftypefnx Macro int mpfr_init_set_z (mpfr_t @var{rop}, mpz_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefnx Macro int mpfr_init_set_q (mpfr_t @var{rop}, mpq_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefnx Macro int mpfr_init_set_f (mpfr_t @var{rop}, mpf_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefn Macro int mpfr_init_set (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefnx Macro int mpfr_init_set_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefnx Macro int mpfr_init_set_si (mpfr_t @var{rop}, signed long int @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefnx Macro int mpfr_init_set_d (mpfr_t @var{rop}, double @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefnx Macro int mpfr_init_set_ld (mpfr_t @var{rop}, long double @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefnx Macro int mpfr_init_set_z (mpfr_t @var{rop}, mpz_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefnx Macro int mpfr_init_set_q (mpfr_t @var{rop}, mpq_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefnx Macro int mpfr_init_set_f (mpfr_t @var{rop}, mpf_t @var{op}, mpfr_rnd_t @var{rnd}) Initialize @var{rop} and set its value from @var{op}, rounded in the direction @var{rnd}. The precision of @var{rop} will be taken from the active default precision, as set by @code{mpfr_set_default_prec}. @end deftypefn -@deftypefun int mpfr_init_set_str (mpfr_t @var{x}, const char *@var{s}, int @var{base}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_init_set_str (mpfr_t @var{x}, const char *@var{s}, int @var{base}, mpfr_rnd_t @var{rnd}) Initialize @var{x} and set its value from the string @var{s} in base @var{base}, rounded in the direction @var{rnd}. @@ -1226,9 +1226,9 @@ See @code{mpfr_set_str}. @cindex Conversion functions @section Conversion Functions -@deftypefun double mpfr_get_d (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx {long double} mpfr_get_ld (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx _Decimal64 mpfr_get_decimal64 (mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun double mpfr_get_d (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx {long double} mpfr_get_ld (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx _Decimal64 mpfr_get_decimal64 (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Convert @var{op} to a @code{double} (respectively @code{_Decimal64} or @code{long double}), using the rounding mode @var{rnd}. If @var{op} is NaN, some fixed NaN (either quiet or signaling) or the result @@ -1239,8 +1239,8 @@ The @code{mpfr_get_decimal64} function is built only under some conditions: see the documentation of @code{mpfr_set_decimal64}. @end deftypefun -@deftypefun double mpfr_get_d_2exp (long *@var{exp}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx {long double} mpfr_get_ld_2exp (long *@var{exp}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun double mpfr_get_d_2exp (long *@var{exp}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx {long double} mpfr_get_ld_2exp (long *@var{exp}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Return @var{d} and set @var{exp} such that @math{0.5@le{}@GMPabs{@var{d}}<1} and @m{@var{d}\times 2^{exp}, @var{d} times 2 raised to @var{exp}} equals @var{op} rounded to double (resp.@: long double) @@ -1254,10 +1254,10 @@ If @var{op} is NaN or an infinity, then the corresponding double precision value is returned, and @var{exp} is undefined. @end deftypefun -@deftypefun long mpfr_get_si (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx {unsigned long} mpfr_get_ui (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx intmax_t mpfr_get_sj (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx uintmax_t mpfr_get_uj (mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun long mpfr_get_si (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx {unsigned long} mpfr_get_ui (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx intmax_t mpfr_get_sj (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx uintmax_t mpfr_get_uj (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Convert @var{op} to a @code{long}, an @code{unsigned long}, an @code{intmax_t} or an @code{uintmax_t} (respectively) after rounding it with respect to @var{rnd}. @@ -1285,12 +1285,12 @@ If the exponent is not representable in the @code{mp_exp_t} type, the behavior is undefined. @end deftypefun -@deftypefun int mpfr_get_z (mpz_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_get_z (mpz_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Convert @var{op} to a @code{mpz_t}, after rounding it with respect to @var{rnd}. If @var{op} is NaN or Inf, the result is undefined. @end deftypefun -@deftypefun int mpfr_get_f (mpf_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_get_f (mpf_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Convert @var{op} to a @code{mpf_t}, after rounding it with respect to @var{rnd}. Return the usual ternary value. Notice that the meaning of the returned value @@ -1299,7 +1299,7 @@ The @emph{erange} flag is set if @var{op} is NaN or Inf, which do not exist in @code{mpf}. @end deftypefun -@deftypefun {char *} mpfr_get_str (char *@var{str}, mp_exp_t *@var{expptr}, int @var{b}, size_t @var{n}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun {char *} mpfr_get_str (char *@var{str}, mp_exp_t *@var{expptr}, int @var{b}, size_t @var{n}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Convert @var{op} to a string of digits in base @var{b}, with rounding in the direction @var{rnd}, where @var{n} is either zero (see below) or the number of significant digits; in the latter case, @var{n} must be greater @@ -1364,14 +1364,14 @@ see Section ``Custom Allocation'' in @cite{GNU MP}. @end ifnotinfo @end deftypefun -@deftypefun int mpfr_fits_ulong_p (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_fits_slong_p (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_fits_uint_p (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_fits_sint_p (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_fits_ushort_p (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_fits_sshort_p (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_fits_intmax_p (mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_fits_uintmax_p (mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_fits_ulong_p (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_fits_slong_p (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_fits_uint_p (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_fits_sint_p (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_fits_ushort_p (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_fits_sshort_p (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_fits_intmax_p (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_fits_uintmax_p (mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Return non-zero if @var{op} would fit in the respective C data type, when rounded to an integer in the direction @var{rnd}. @end deftypefun @@ -1383,12 +1383,12 @@ rounded to an integer in the direction @var{rnd}. @cindex Arithmetic functions @section Basic Arithmetic Functions -@deftypefun int mpfr_add (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_add_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_add_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_add_d (mpfr_t @var{rop}, mpfr_t @var{op1}, double @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_add_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_add_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_add (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_add_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_add_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_add_d (mpfr_t @var{rop}, mpfr_t @var{op1}, double @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_add_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_add_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @math{@var{op1} + @var{op2}} rounded in the direction @var{rnd}. For types having no signed zero, it is considered unsigned (i.e.@: (+0) + 0 = (+0) and (@minus{}0) + 0 = (@minus{}0)). @@ -1397,15 +1397,15 @@ is a power of 2, with a precision at most that declared by the C implementation (macro @code{IEEE_DBL_MANT_DIG}, and if not defined 53 bits). @end deftypefun -@deftypefun int mpfr_sub (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_ui_sub (mpfr_t @var{rop}, unsigned long int @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_sub_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_si_sub (mpfr_t @var{rop}, long int @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_sub_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_d_sub (mpfr_t @var{rop}, double @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_sub_d (mpfr_t @var{rop}, mpfr_t @var{op1}, double @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_sub_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_sub_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_sub (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_ui_sub (mpfr_t @var{rop}, unsigned long int @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_sub_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_si_sub (mpfr_t @var{rop}, long int @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_sub_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_d_sub (mpfr_t @var{rop}, double @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_sub_d (mpfr_t @var{rop}, mpfr_t @var{op1}, double @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_sub_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_sub_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @math{@var{op1} - @var{op2}} rounded in the direction @var{rnd}. For types having no signed zero, it is considered unsigned (i.e.@: (+0) @minus{} 0 = (+0), (@minus{}0) @minus{} 0 = (@minus{}0), @@ -1414,12 +1414,12 @@ The same restrictions than for @code{mpfr_add_d} apply to @code{mpfr_d_sub} and @code{mpfr_sub_d}. @end deftypefun -@deftypefun int mpfr_mul (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_mul_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_mul_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_mul_d (mpfr_t @var{rop}, mpfr_t @var{op1}, double @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_mul_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_mul_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_mul (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_mul_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_mul_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_mul_d (mpfr_t @var{rop}, mpfr_t @var{op1}, double @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_mul_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_mul_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @math{@var{op1} @GMPtimes{} @var{op2}} rounded in the direction @var{rnd}. When a result is zero, its sign is the product of the signs of the operands @@ -1427,20 +1427,20 @@ When a result is zero, its sign is the product of the signs of the operands The same restrictions than for @code{mpfr_add_d} apply to @code{mpfr_mul_d}. @end deftypefun -@deftypefun int mpfr_sqr (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_sqr (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @m{@var{op}^{2}, the square of @var{op}} rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_div (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_ui_div (mpfr_t @var{rop}, unsigned long int @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_div_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_si_div (mpfr_t @var{rop}, long int @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_div_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_d_div (mpfr_t @var{rop}, double @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_div_d (mpfr_t @var{rop}, mpfr_t @var{op1}, double @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_div_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_div_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_div (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_ui_div (mpfr_t @var{rop}, unsigned long int @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_div_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_si_div (mpfr_t @var{rop}, long int @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_div_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_d_div (mpfr_t @var{rop}, double @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_div_d (mpfr_t @var{rop}, mpfr_t @var{op1}, double @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_div_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_div_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @math{@var{op1}/@var{op2}} rounded in the direction @var{rnd}. When a result is zero, its sign is the product of the signs of the operands (for types having no signed zero, it is considered positive). @@ -1448,23 +1448,23 @@ The same restrictions than for @code{mpfr_add_d} apply to @code{mpfr_d_div} and @code{mpfr_div_d}. @end deftypefun -@deftypefun int mpfr_sqrt (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_sqrt_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_sqrt (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_sqrt_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @m{\sqrt{@var{op}}, the square root of @var{op}} rounded in the direction @var{rnd}. Return @minus{}0 if @var{op} is @minus{}0 (to be consistent with the IEEE 754 standard). Set @var{rop} to NaN if @var{op} is negative. @end deftypefun -@deftypefun int mpfr_rec_sqrt (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_rec_sqrt (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @m{1/\sqrt{@var{op}}, the reciprocal square root of @var{op}} rounded in the direction @var{rnd}. Return +Inf if @var{op} is @pom{}0, and +0 if @var{op} is +Inf. Set @var{rop} to NaN if @var{op} is negative. @end deftypefun -@deftypefun int mpfr_cbrt (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_root (mpfr_t @var{rop}, mpfr_t @var{op}, unsigned long int @var{k}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_cbrt (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_root (mpfr_t @var{rop}, mpfr_t @var{op}, unsigned long int @var{k}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the cubic root (resp.@: the @var{k}th root) of @var{op} rounded in the direction @var{rnd}. An odd (resp.@: even) root of a negative number (including @minus{}Inf) @@ -1473,12 +1473,12 @@ The @var{k}th root of @minus{}0 is defined to be @minus{}0, whatever the parity of @var{k}. @end deftypefun -@deftypefun int mpfr_pow (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_pow_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_pow_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_pow_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_ui_pow_ui (mpfr_t @var{rop}, unsigned long int @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_ui_pow (mpfr_t @var{rop}, unsigned long int @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_pow (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_pow_ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_pow_si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_pow_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_ui_pow_ui (mpfr_t @var{rop}, unsigned long int @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_ui_pow (mpfr_t @var{rop}, unsigned long int @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @m{@var{op1}^{op2}, @var{op1} raised to @var{op2}}, rounded in the direction @var{rnd}. Special values are currently handled as described in the ISO C99 standard @@ -1502,34 +1502,34 @@ for the @code{pow} function (note this may change in future versions): @end itemize @end deftypefun -@deftypefun int mpfr_neg (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_neg (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @math{-@var{op}} rounded in the direction @var{rnd}. Just changes the sign if @var{rop} and @var{op} are the same variable. @end deftypefun -@deftypefun int mpfr_abs (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_abs (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the absolute value of @var{op}, rounded in the direction @var{rnd}. Just changes the sign if @var{rop} and @var{op} are the same variable. @end deftypefun -@deftypefun int mpfr_dim (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_dim (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the positive difference of @var{op1} and @var{op2}, i.e., @math{@var{op1} - @var{op2}} rounded in the direction @var{rnd} if @math{@var{op1} > @var{op2}}, and +0 otherwise. Returns NaN when @var{op1} or @var{op2} is NaN. @end deftypefun -@deftypefun int mpfr_mul_2ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_mul_2si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_mul_2ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_mul_2si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @m{@var{op1} \times 2^{op2}, @var{op1} times 2 raised to @var{op2}} rounded in the direction @var{rnd}. Just increases the exponent by @var{op2} when @var{rop} and @var{op1} are identical. @end deftypefun -@deftypefun int mpfr_div_2ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_div_2si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_div_2ui (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_div_2si (mpfr_t @var{rop}, mpfr_t @var{op1}, long int @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @m{@var{op1}/2^{op2}, @var{op1} divided by 2 raised to @var{op2}} rounded in the direction @var{rnd}. Just decreases the exponent by @var{op2} @@ -1638,9 +1638,9 @@ Important note: in some domains, computing special functions (either with correct or incorrect rounding) is expensive, even for small precision, for example the trigonometric and Bessel functions for large argument. -@deftypefun int mpfr_log (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_log2 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_log10 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_log (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_log2 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_log10 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the natural logarithm of @var{op}, @m{\log_2 @var{op}, log2(@var{op})} or @m{\log_{10} @var{op}, log10(@var{op})}, respectively, @@ -1649,30 +1649,30 @@ Return @minus{}Inf if @var{op} is @minus{}0 (i.e.@: the sign of the zero has no influence on the result). @end deftypefun -@deftypefun int mpfr_exp (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_exp2 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_exp10 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_exp (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_exp2 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_exp10 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the exponential of @var{op}, to @m{2^{op}, 2 power of @var{op}} or to @m{10^{op}, 10 power of @var{op}}, respectively, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_cos (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_sin (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_tan (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_cos (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_sin (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_tan (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the cosine of @var{op}, sine of @var{op}, tangent of @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_sec (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_csc (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_cot (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_sec (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_csc (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_cot (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the secant of @var{op}, cosecant of @var{op}, cotangent of @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_sin_cos (mpfr_t @var{sop}, mpfr_t @var{cop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_sin_cos (mpfr_t @var{sop}, mpfr_t @var{cop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set simultaneously @var{sop} to the sine of @var{op} and @var{cop} to the cosine of @var{op}, rounded in the direction @var{rnd} with the corresponding precisions of @@ -1680,9 +1680,9 @@ rounded in the direction @var{rnd} with the corresponding precisions of Return 0 iff both results are exact. @end deftypefun -@deftypefun int mpfr_acos (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_asin (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_atan (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_acos (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_asin (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_atan (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the arc-cosine, arc-sine or arc-tangent of @var{op}, rounded in the direction @var{rnd}. Note that since @code{acos(-1)} returns the floating-point number closest to @@ -1695,7 +1695,7 @@ The same holds for @code{asin(-1)}, @code{asin(1)}, @code{atan(-Inf)}, @code{atan(+Inf)}. @end deftypefun -@deftypefun int mpfr_atan2 (mpfr_t @var{rop}, mpfr_t @var{y}, mpfr_t @var{x}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_atan2 (mpfr_t @var{rop}, mpfr_t @var{y}, mpfr_t @var{x}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the arc-tangent2 of @var{y} and @var{x}, rounded in the direction @var{rnd}: if @code{x > 0}, @code{atan2(y, x) = atan (y/x)}; @@ -1730,14 +1730,14 @@ for the @code{atan2} function (note this may change in future versions): @end itemize @end deftypefun -@deftypefun int mpfr_cosh (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_sinh (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_tanh (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_cosh (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_sinh (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_tanh (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the hyperbolic cosine, sine or tangent of @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_sinh_cosh (mpfr_t @var{sop}, mpfr_t @var{cop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_sinh_cosh (mpfr_t @var{sop}, mpfr_t @var{cop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set simultaneously @var{sop} to the hyperbolic sine of @var{op} and @var{cop} to the hyperbolic cosine of @var{op}, rounded in the direction @var{rnd} with the corresponding precision of @@ -1745,36 +1745,36 @@ rounded in the direction @var{rnd} with the corresponding precision of Return 0 iff both results are exact. @end deftypefun -@deftypefun int mpfr_sech (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_csch (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_coth (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_sech (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_csch (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_coth (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the hyperbolic secant of @var{op}, cosecant of @var{op}, cotangent of @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_acosh (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_asinh (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_atanh (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_acosh (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_asinh (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_atanh (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the inverse hyperbolic cosine, sine or tangent of @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_fac_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_fac_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the factorial of the @code{unsigned long int} @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_log1p (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_log1p (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the logarithm of one plus @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_expm1 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_expm1 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the exponential of @var{op} minus one, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_eint (mpfr_t @var{y}, mpfr_t @var{x}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_eint (mpfr_t @var{y}, mpfr_t @var{x}, mpfr_rnd_t @var{rnd}) Set @var{y} to the exponential integral of @var{x}, rounded in the direction @var{rnd}. For positive @var{x}, @@ -1789,18 +1789,18 @@ $x^k/k/k!$. For negative @var{x}, the returned value is NaN. @end deftypefun -@deftypefun int mpfr_li2 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd_mode}) +@deftypefun int mpfr_li2 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd_mode}) Set @var{rop} to real part of the dilogarithm of @var{op}, rounded in the direction @var{rnd_mode}. The dilogarithm function is defined here as @m{-\int_{t=0}^x log(1-t)/t dt,the integral of -log(1-t)/t from 0 to x}. @end deftypefun -@deftypefun int mpfr_gamma (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_gamma (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the value of the Gamma function on @var{op}, rounded in the direction @var{rnd}. When @var{op} is a negative integer, NaN is returned. @end deftypefun -@deftypefun int mpfr_lngamma (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_lngamma (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the value of the logarithm of the Gamma function on @var{op}, rounded in the direction @var{rnd}. When @math{@minus{}2@var{k}@minus{}1 @le{} @var{x} @le{} @minus{}2@var{k}}, @@ -1808,7 +1808,7 @@ When @math{@minus{}2@var{k}@minus{}1 @le{} @var{x} @le{} @minus{}2@var{k}}, See also @code{mpfr_lgamma}. @end deftypefun -@deftypefun int mpfr_lgamma (mpfr_t @var{rop}, int *@var{signp}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_lgamma (mpfr_t @var{rop}, int *@var{signp}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the value of the logarithm of the absolute value of the Gamma function on @var{op}, rounded in the direction @var{rnd}. The sign (1 or @minus{}1) of Gamma(@var{op}) is returned in the object pointed to @@ -1818,25 +1818,25 @@ by @var{signp}. When @var{op} is an infinity or a non-positive integer, the sign of the zero. @end deftypefun -@deftypefun int mpfr_zeta (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_zeta_ui (mpfr_t @var{rop}, unsigned long @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_zeta (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_zeta_ui (mpfr_t @var{rop}, unsigned long @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the value of the Riemann Zeta function on @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_erf (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_erf (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the value of the error function on @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_erfc (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_erfc (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the value of the complementary error function on @var{op}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_j0 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_j1 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_jn (mpfr_t @var{rop}, long @var{n}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_j0 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_j1 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_jn (mpfr_t @var{rop}, long @var{n}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the value of the first kind Bessel function of order 0, 1 and @var{n} on @var{op}, rounded in the direction @var{rnd}. When @var{op} is NaN, @var{rop} is always set to NaN. When @var{op} is plus or minus Infinity, @@ -1845,9 +1845,9 @@ NaN, @var{rop} is always set to NaN. When @var{op} is plus or minus Infinity, and the sign of @var{op}. @end deftypefun -@deftypefun int mpfr_y0 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_y1 (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_yn (mpfr_t @var{rop}, long @var{n}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_y0 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_y1 (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_yn (mpfr_t @var{rop}, long @var{n}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the value of the second kind Bessel function of order 0, 1 and @var{n} on @var{op}, rounded in the direction @var{rnd}. When @var{op} is NaN or negative, @@ -1856,17 +1856,17 @@ NaN or negative, @var{rop} is +Inf or @minus{}Inf depending on the parity and sign of @var{n}. @end deftypefun -@deftypefun int mpfr_fma (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_t @var{op3}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_fma (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_t @var{op3}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @math{(@var{op1} @GMPtimes{} @var{op2}) + @var{op3}}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_fms (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_t @var{op3}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_fms (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_t @var{op3}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @math{(@var{op1} @GMPtimes{} @var{op2}) - @var{op3}}, rounded in the direction @var{rnd}. @end deftypefun -@deftypefun int mpfr_agm (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_agm (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the arithmetic-geometric mean of @var{op1} and @var{op2}, rounded in the direction @var{rnd}. The arithmetic-geometric mean is the common limit of the sequences @@ -1876,7 +1876,7 @@ u[n] and v[n]. If any operand is negative, the return value is NaN. @end deftypefun -@deftypefun int mpfr_hypot (mpfr_t @var{rop}, mpfr_t @var{x}, mpfr_t @var{y}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_hypot (mpfr_t @var{rop}, mpfr_t @var{x}, mpfr_t @var{y}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the Euclidean norm of @var{x} and @var{y}, @ifnottex i.e.@: the square root of the sum of the squares of @var{x} and @var{y}, @@ -1891,10 +1891,10 @@ in future versions): If @var{x} or @var{y} is an infinity, then plus infinity is returned in @var{rop}, even if the other number is NaN. @end deftypefun -@deftypefun int mpfr_const_log2 (mpfr_t @var{rop}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_const_pi (mpfr_t @var{rop}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_const_euler (mpfr_t @var{rop}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_const_catalan (mpfr_t @var{rop}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_const_log2 (mpfr_t @var{rop}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_const_pi (mpfr_t @var{rop}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_const_euler (mpfr_t @var{rop}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_const_catalan (mpfr_t @var{rop}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the logarithm of 2, the value of @m{\pi,Pi}, of Euler's constant 0.577@dots{}, of Catalan's constant 0.915@dots{}, respectively, rounded in the direction @@ -1912,7 +1912,7 @@ You should call this function before terminating a thread, even if you did not call these functions directly (they could have been called internally). @end deftypefun -@deftypefun int mpfr_sum (mpfr_t @var{rop}, mpfr_ptr const @var{tab}[], unsigned long @var{n}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_sum (mpfr_t @var{rop}, mpfr_ptr const @var{tab}[], unsigned long @var{n}, mpfr_rnd_t @var{rnd}) Set @var{ret} to the sum of all elements of @var{tab} whose size is @var{n}, rounded in the direction @var{rnd}. Warning, @var{tab} is a table of pointers to mpfr_t, not a table of mpfr_t (preliminary interface). The returned @@ -1939,7 +1939,7 @@ When using any of these functions, you must include the @code{<stdio.h>} standard header before @file{mpfr.h}, to allow @file{mpfr.h} to define prototypes for these functions. -@deftypefun size_t mpfr_out_str (FILE *@var{stream}, int @var{base}, size_t @var{n}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun size_t mpfr_out_str (FILE *@var{stream}, int @var{base}, size_t @var{n}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Output @var{op} on stream @var{stream}, as a string of digits in base @var{base}, rounded in the direction @var{rnd}. The base may vary from 2 to 62. Print @var{n} significant digits exactly, @@ -1955,7 +1955,7 @@ instead of @samp{e} as exponent delimiter. Return the number of bytes written, or if an error occurred, return 0. @end deftypefun -@deftypefun size_t mpfr_inp_str (mpfr_t @var{rop}, FILE *@var{stream}, int @var{base}, mp_rnd_t @var{rnd}) +@deftypefun size_t mpfr_inp_str (mpfr_t @var{rop}, FILE *@var{stream}, int @var{base}, mpfr_rnd_t @var{rnd}) Input a string in base @var{base} from stream @var{stream}, rounded in the direction @var{rnd}, and put the read float in @var{rop}. @@ -2087,7 +2087,7 @@ one of the following characters: @item @samp{D} @tab round toward minus infinity @item @samp{Z} @tab round toward zero @item @samp{N} @tab round to nearest -@item @samp{*} @tab rounding mode indicated by the @code{mp_rnd_t} argument +@item @samp{*} @tab rounding mode indicated by the @code{mpfr_rnd_t} argument just before the corresponding @code{mpfr_t} variable. @end multitable @end quotation @@ -2223,7 +2223,7 @@ the @emph{erange} flag, and (in POSIX system only) @code{errno} is set to @cindex Integer related functions @section Integer and Remainder Related Functions -@deftypefun int mpfr_rint (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_rint (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) @deftypefunx int mpfr_ceil (mpfr_t @var{rop}, mpfr_t @var{op}) @deftypefunx int mpfr_floor (mpfr_t @var{rop}, mpfr_t @var{op}) @deftypefunx int mpfr_round (mpfr_t @var{rop}, mpfr_t @var{op}) @@ -2252,10 +2252,10 @@ in binary) in 2-bit precision, though @code{round(4.5)} is equal to 5 and 5 (101 in binary) is rounded to 6 (110 in binary) in 2-bit precision. @end deftypefun -@deftypefun int mpfr_rint_ceil (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_rint_floor (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_rint_round (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_rint_trunc (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_rint_ceil (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_rint_floor (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_rint_round (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_rint_trunc (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to @var{op} rounded to an integer. @code{mpfr_rint_ceil} rounds to the next higher or equal integer, @code{mpfr_rint_floor} to the next lower or equal integer, @@ -2267,14 +2267,14 @@ round-to-integer function (regarded in the same way as any other mathematical function). @end deftypefun -@deftypefun int mpfr_frac (mpfr_t @var{rop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_frac (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the fractional part of @var{op}, having the same sign as @var{op}, rounded in the direction @var{rnd} (unlike in @code{mpfr_rint}, @var{rnd} affects only how the exact fractional part is rounded, not how the fractional part is generated). @end deftypefun -@deftypefun int mpfr_modf (mpfr_t @var{iop}, mpfr_t @var{fop}, mpfr_t @var{op}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_modf (mpfr_t @var{iop}, mpfr_t @var{fop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd}) Set simultaneously @var{iop} to the integral part of @var{op} and @var{fop} to the fractional part of @var{op}, rounded in the direction @var{rnd} with the corresponding precision of @var{iop} and @var{fop} (equivalent to @@ -2283,9 +2283,9 @@ corresponding precision of @var{iop} and @var{fop} (equivalent to @var{fop} must be different. Return 0 iff both results are exact. @end deftypefun -@deftypefun int mpfr_fmod (mpfr_t @var{r}, mpfr_t @var{x}, mpfr_t @var{y}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_remainder (mpfr_t @var{r}, mpfr_t @var{x}, mpfr_t @var{y}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_remquo (mpfr_t @var{r}, long* @var{q}, mpfr_t @var{x}, mpfr_t @var{y}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_fmod (mpfr_t @var{r}, mpfr_t @var{x}, mpfr_t @var{y}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_remainder (mpfr_t @var{r}, mpfr_t @var{x}, mpfr_t @var{y}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_remquo (mpfr_t @var{r}, long* @var{q}, mpfr_t @var{x}, mpfr_t @var{y}, mpfr_rnd_t @var{rnd}) Set @var{r} to the value of @math{x - n y}, rounded according to the direction @var{rnd}, where @math{n} is the integer quotient of @var{x} divided by @var{y}, defined as follows: @math{n} is rounded toward zero for @@ -2319,16 +2319,16 @@ Return non-zero iff @var{op} is an integer. @cindex Rounding mode related functions @section Rounding Related Functions -@deftypefun void mpfr_set_default_rounding_mode (mp_rnd_t @var{rnd}) +@deftypefun void mpfr_set_default_rounding_mode (mpfr_rnd_t @var{rnd}) Set the default rounding mode to @var{rnd}. The default rounding mode is to nearest initially. @end deftypefun -@deftypefun mp_rnd_t mpfr_get_default_rounding_mode (void) +@deftypefun mpfr_rnd_t mpfr_get_default_rounding_mode (void) Get the default rounding mode. @end deftypefun -@deftypefun int mpfr_prec_round (mpfr_t @var{x}, mp_prec_t @var{prec}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_prec_round (mpfr_t @var{x}, mp_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). @@ -2338,11 +2338,11 @@ Otherwise, the significand is rounded to precision @var{prec} with the given direction. In both cases, the precision of @var{x} is changed to @var{prec}. @end deftypefun -@deftypefun int mpfr_round_prec (mpfr_t @var{x}, mp_rnd_t @var{rnd}, mp_prec_t @var{prec}) +@deftypefun int mpfr_round_prec (mpfr_t @var{x}, mpfr_rnd_t @var{rnd}, mp_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}, mp_rnd_t @var{rnd1}, mp_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}, mp_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 @@ -2373,7 +2373,7 @@ value can be less than @code{MPFR_PREC_MIN}.) The function name is subject to change. @end deftypefun -@deftypefun {const char *} mpfr_print_rnd_mode (mp_rnd_t @var{rnd}) +@deftypefun {const char *} mpfr_print_rnd_mode (mpfr_rnd_t @var{rnd}) Return the input string (MPFR_RNDD, MPFR_RNDU, MPFR_RNDN, MPFR_RNDZ) corresponding to the rounding mode @var{rnd} or a null pointer if @var{rnd} is an invalid rounding mode. @@ -2402,7 +2402,7 @@ Equivalent to @code{mpfr_nexttoward} where @var{y} is plus infinity. Equivalent to @code{mpfr_nexttoward} where @var{y} is minus infinity. @end deftypefun -@deftypefun int mpfr_min (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_min (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the minimum of @var{op1} and @var{op2}. If @var{op1} and @var{op2} are both NaN, then @var{rop} is set to NaN. If @var{op1} or @var{op2} is NaN, then @var{rop} is set to the numeric value. If @@ -2410,7 +2410,7 @@ or @var{op2} is NaN, then @var{rop} is set to the numeric value. If is set to @minus{}0. @end deftypefun -@deftypefun int mpfr_max (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_max (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) Set @var{rop} to the maximum of @var{op1} and @var{op2}. If @var{op1} and @var{op2} are both NaN, then @var{rop} is set to NaN. If @var{op1} or @var{op2} is NaN, then @var{rop} is set to the numeric value. If @@ -2449,13 +2449,13 @@ Return a non-zero value iff @var{op} has its sign bit set (i.e.@: if it is negative, @minus{}0, or a NaN whose representation has its sign bit set). @end deftypefun -@deftypefun int mpfr_setsign (mpfr_t @var{rop}, mpfr_t @var{op}, int @var{s}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_setsign (mpfr_t @var{rop}, mpfr_t @var{op}, int @var{s}, mpfr_rnd_t @var{rnd}) Set the value of @var{rop} from @var{op}, rounded toward the given direction @var{rnd}, then set (resp.@: clear) its sign bit if @var{s} is non-zero (resp.@: zero), even when @var{op} is a NaN. @end deftypefun -@deftypefun int mpfr_copysign (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_copysign (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) Set the value of @var{rop} from @var{op1}, rounded toward the given direction @var{rnd}, then set its sign bit to that of @var{op2} (even when @var{op1} or @var{op2} is a NaN). This function is equivalent to @@ -2565,7 +2565,7 @@ and @code{mpfr_set_emin(mpfr_get_emin_min())} since the values of the smallest and largest exponents become implementation dependent. @end deftypefun -@deftypefun int mpfr_check_range (mpfr_t @var{x}, int @var{t}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_check_range (mpfr_t @var{x}, int @var{t}, mpfr_rnd_t @var{rnd}) This function forces @var{x} to be in the current range of acceptable values, @var{t} being the current ternary value: negative if @var{x} is smaller than the exact value, positive if @var{x} is larger than @@ -2586,7 +2586,7 @@ set. This is useful because @code{mpfr_check_range} is typically called been set due to internal computations. @end deftypefun -@deftypefun int mpfr_subnormalize (mpfr_t @var{x}, int @var{t}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_subnormalize (mpfr_t @var{x}, int @var{t}, mpfr_rnd_t @var{rnd}) This function rounds @var{x} emulating subnormal number arithmetic: if @var{x} is outside the subnormal exponent range, it just propagates the ternary value @var{t}; otherwise, it rounds @var{x} to precision @@ -2708,7 +2708,7 @@ you want to know whether two numbers are close to each other; for instance, @var{op3} larger than 1 (but this may change in the next release). @end deftypefun -@deftypefun void mpfr_reldiff (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun void mpfr_reldiff (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd}) Compute the relative difference between @var{op1} and @var{op2} and store the result in @var{rop}. This function does not guarantee the correct rounding on the relative @@ -2716,8 +2716,8 @@ difference; it just computes @math{|@var{op1}-@var{op2}|/@var{op1}}, using the rounding mode @var{rnd} for all operations and the precision of @var{rop}. @end deftypefun -@deftypefun int mpfr_mul_2exp (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) -@deftypefunx int mpfr_div_2exp (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mp_rnd_t @var{rnd}) +@deftypefun int mpfr_mul_2exp (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) +@deftypefunx int mpfr_div_2exp (mpfr_t @var{rop}, mpfr_t @var{op1}, unsigned long int @var{op2}, mpfr_rnd_t @var{rnd}) See @code{mpfr_mul_2ui} and @code{mpfr_div_2ui}. These functions are only kept for compatibility with MPF. @end deftypefun @@ -31,9 +31,9 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef WANT_ASSERT # if WANT_ASSERT >= 3 -int mpfr_mul2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode); +int mpfr_mul2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode); static int -mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { /* Old implementation */ int sign_product, cc, inexact; @@ -158,7 +158,7 @@ mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) } int -mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mpfr_t ta, tb, tc; int inexact1, inexact2; @@ -203,7 +203,7 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) /* Multiply 2 mpfr_t */ int -mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int sign, inexact; mp_exp_t ax, ax2; diff --git a/mul_2exp.c b/mul_2exp.c index 0941cac03..225cb3a37 100644 --- a/mul_2exp.c +++ b/mul_2exp.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #undef mpfr_mul_2exp int -mpfr_mul_2exp (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mp_rnd_t rnd_mode) +mpfr_mul_2exp (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mpfr_rnd_t rnd_mode) { return mpfr_mul_2ui (y, x, n, rnd_mode); } @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_mul_2si (mpfr_ptr y, mpfr_srcptr x, long int n, mp_rnd_t rnd_mode) +mpfr_mul_2si (mpfr_ptr y, mpfr_srcptr x, long int n, mpfr_rnd_t rnd_mode) { int inexact; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_mul_2ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mp_rnd_t rnd_mode) +mpfr_mul_2ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mpfr_rnd_t rnd_mode) { int inexact; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_mul_d (mpfr_ptr a, mpfr_srcptr b, double c, mp_rnd_t rnd_mode) +mpfr_mul_d (mpfr_ptr a, mpfr_srcptr b, double c, mpfr_rnd_t rnd_mode) { int inexact; mpfr_t d; @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_mul_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) +mpfr_mul_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode) { mp_limb_t *yp; mp_size_t xn; @@ -118,7 +118,7 @@ mpfr_mul_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) return inexact; } -int mpfr_mul_si (mpfr_ptr y, mpfr_srcptr x, long int u, mp_rnd_t rnd_mode) +int mpfr_mul_si (mpfr_ptr y, mpfr_srcptr x, long int u, mpfr_rnd_t rnd_mode) { int res; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_neg (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +mpfr_neg (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { if (MPFR_UNLIKELY(a != b)) return mpfr_set4 (a, b, rnd_mode, -MPFR_SIGN(b)); @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., size_t mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op, - mp_rnd_t rnd_mode) + mpfr_rnd_t rnd_mode) { char *s, *s0; size_t l; @@ -31,7 +31,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ static int mpfr_pow_is_exact (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, - mp_rnd_t rnd_mode, int *inexact) + mpfr_rnd_t rnd_mode, int *inexact) { mpz_t a, c; mp_exp_t d, b; @@ -158,7 +158,7 @@ is_odd (mpfr_srcptr y) an integer, then the result is not exact in unbounded exponent range. */ int mpfr_pow_general (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, - mp_rnd_t rnd_mode, int y_is_integer, mpfr_save_expo_t *expo) + mpfr_rnd_t rnd_mode, int y_is_integer, mpfr_save_expo_t *expo) { mpfr_t t, u, k, absx; int k_non_zero = 0; @@ -379,7 +379,7 @@ mpfr_pow_general (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, _ pow(+inf, y) = +0 for y < 0. _ pow(+inf, y) = +inf for y > 0. */ int -mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode) +mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) { int inexact; int cmp_x_1; @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_pow_si (mpfr_ptr y, mpfr_srcptr x, long int n, mp_rnd_t rnd) +mpfr_pow_si (mpfr_ptr y, mpfr_srcptr x, long int n, mpfr_rnd_t rnd) { MPFR_LOG_FUNC (("x[%#R]=%R n=%ld rnd=%d", x, x, n, rnd), ("y[%#R]=%R", y, y)); @@ -135,7 +135,7 @@ mpfr_pow_si (mpfr_ptr y, mpfr_srcptr x, long int n, mp_rnd_t rnd) /* Declaration of the size variable */ mp_prec_t Ny; /* target precision */ mp_prec_t Nt; /* working precision */ - mp_rnd_t rnd1; + mpfr_rnd_t rnd1; int size_n; int inexact; unsigned long abs_n; @@ -26,13 +26,13 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* sets y to x^n, and return 0 if exact, non-zero otherwise */ int -mpfr_pow_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mp_rnd_t rnd) +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; int inexact; - mp_rnd_t rnd1; + mpfr_rnd_t rnd1; MPFR_SAVE_EXPO_DECL (expo); MPFR_ZIV_DECL (loop); MPFR_BLOCK_DECL (flags); @@ -29,12 +29,12 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., or underflow, and uses the precision of y as working precision (warning, y and x might be the same variable). */ static int -mpfr_pow_pos_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t rnd, int cr) +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; int inexact; - mp_rnd_t rnd1, rnd2; + mpfr_rnd_t rnd1, rnd2; mpz_t absz; mp_size_t size_z; MPFR_ZIV_DECL (loop); @@ -161,7 +161,7 @@ mpfr_pow_pos_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t rnd, int cr) */ int -mpfr_pow_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t rnd) +mpfr_pow_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t rnd) { int inexact; mpz_t tmp; @@ -261,7 +261,7 @@ mpfr_pow_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t rnd) /* Declaration of the intermediary variable */ mpfr_t t; mp_prec_t Nt; /* Precision of the intermediary variable */ - mp_rnd_t rnd1; + mpfr_rnd_t rnd1; mp_size_t size_z; MPFR_ZIV_DECL (loop); diff --git a/print_rnd_mode.c b/print_rnd_mode.c index 5c3a7b1fb..515e1c2e3 100644 --- a/print_rnd_mode.c +++ b/print_rnd_mode.c @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" const char * -mpfr_print_rnd_mode (mp_rnd_t rnd_mode) +mpfr_print_rnd_mode (mpfr_rnd_t rnd_mode) { switch (rnd_mode) { diff --git a/rec_sqrt.c b/rec_sqrt.c index 130f5d63c..5395104e1 100644 --- a/rec_sqrt.c +++ b/rec_sqrt.c @@ -416,7 +416,7 @@ mpfr_mpn_rec_sqrt (mp_ptr x, mp_prec_t p, } int -mpfr_rec_sqrt (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode) +mpfr_rec_sqrt (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) { mp_prec_t rp, up, wp; mp_size_t rn, wn; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* reldiff(b, c) = abs(b-c)/b */ void -mpfr_reldiff (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_reldiff (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mpfr_t b_copy; @@ -53,8 +53,8 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ static int -mpfr_rem1 (mpfr_ptr rem, long *quo, mp_rnd_t rnd_q, - mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd) +mpfr_rem1 (mpfr_ptr rem, long *quo, mpfr_rnd_t rnd_q, + mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd) { mp_exp_t ex, ey; int compare, inex, q_is_odd, sign, signx = MPFR_SIGN (x); @@ -212,20 +212,20 @@ mpfr_rem1 (mpfr_ptr rem, long *quo, mp_rnd_t rnd_q, } int -mpfr_remainder (mpfr_ptr rem, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd) +mpfr_remainder (mpfr_ptr rem, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd) { return mpfr_rem1 (rem, (long *) 0, MPFR_RNDN, x, y, rnd); } int mpfr_remquo (mpfr_ptr rem, long *quo, - mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd) + mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd) { return mpfr_rem1 (rem, quo, MPFR_RNDN, x, y, rnd); } int -mpfr_fmod (mpfr_ptr rem, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd) +mpfr_fmod (mpfr_ptr rem, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd) { return mpfr_rem1 (rem, (long *) 0, MPFR_RNDZ, x, y, rnd); } @@ -39,7 +39,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_root (mpfr_ptr y, mpfr_srcptr x, unsigned long k, mp_rnd_t rnd_mode) +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; diff --git a/round_near_x.c b/round_near_x.c index 78bc83656..a09acc749 100644 --- a/round_near_x.c +++ b/round_near_x.c @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* Use MPFR_FAST_COMPUTE_IF_SMALL_INPUT instead (a simple wrapper) */ /* int mpfr_round_near_x (mpfr_ptr y, mpfr_srcptr v, mpfr_uexp_t err, int dir, - mp_rnd_t rnd) + mpfr_rnd_t rnd) TODO: fix this description. Assuming y = o(f(x)) = o(x + g(x)) with |g(x)| < 2^(EXP(v)-error) @@ -154,7 +154,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int mpfr_round_near_x (mpfr_ptr y, mpfr_srcptr v, mpfr_uexp_t err, int dir, - mp_rnd_t rnd) + mpfr_rnd_t rnd) { int inexact, sign; unsigned int old_flags = __gmpfr_flags; diff --git a/round_prec.c b/round_prec.c index a1e6b2273..4b662ed0a 100644 --- a/round_prec.c +++ b/round_prec.c @@ -46,7 +46,7 @@ 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, mp_rnd_t rnd_mode) +mpfr_prec_round (mpfr_ptr x, mp_prec_t prec, mpfr_rnd_t rnd_mode) { mp_limb_t *tmp, *xp; int carry, inexact; @@ -118,8 +118,8 @@ mpfr_prec_round (mpfr_ptr x, mp_prec_t prec, mp_rnd_t rnd_mode) */ int -mpfr_can_round (mpfr_srcptr b, mp_exp_t err, mp_rnd_t rnd1, - mp_rnd_t rnd2, mp_prec_t prec) +mpfr_can_round (mpfr_srcptr b, mp_exp_t err, mpfr_rnd_t rnd1, + mpfr_rnd_t rnd2, mp_prec_t prec) { if (MPFR_UNLIKELY(MPFR_IS_SINGULAR(b))) return 0; /* We cannot round if Zero, Nan or Inf */ @@ -130,7 +130,7 @@ mpfr_can_round (mpfr_srcptr b, mp_exp_t err, mp_rnd_t rnd1, int mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mp_exp_t err0, - mp_rnd_t rnd1, mp_rnd_t rnd2, mp_prec_t prec) + mpfr_rnd_t rnd1, mpfr_rnd_t rnd2, mp_prec_t prec) { mp_prec_t err; mp_size_t k, k1, tn; diff --git a/round_raw_generic.c b/round_raw_generic.c index cfacd6d3d..402f5ff1e 100644 --- a/round_raw_generic.c +++ b/round_raw_generic.c @@ -56,7 +56,7 @@ mpfr_round_raw_generic( mp_limb_t *yp, #endif const mp_limb_t *xp, mp_prec_t xprec, - int neg, mp_prec_t yprec, mp_rnd_t rnd_mode + int neg, mp_prec_t yprec, mpfr_rnd_t rnd_mode #if use_inexp != 0 , int *inexp #endif @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* set a to abs(b) * signb: a=b when signb = SIGN(b), a=abs(b) when signb=1 */ int -mpfr_set4 (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode, int signb) +mpfr_set4 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, int signb) { /* Sign is ALWAYS copied */ MPFR_SET_SIGN (a, signb); @@ -67,7 +67,7 @@ mpfr_set4 (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode, int signb) /* Set a to b */ #undef mpfr_set int -mpfr_set (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +mpfr_set (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { return mpfr_set4 (a, b, rnd_mode, MPFR_SIGN (b)); } @@ -75,7 +75,7 @@ mpfr_set (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) /* Set a to |b| */ #undef mpfr_abs int -mpfr_abs (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +mpfr_abs (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { return mpfr_set4 (a, b, rnd_mode, MPFR_SIGN_POS); } @@ -140,7 +140,7 @@ __gmpfr_extract_double (mp_ptr rp, double d) /* End of part included from gmp-2.0.2 */ int -mpfr_set_d (mpfr_ptr r, double d, mp_rnd_t rnd_mode) +mpfr_set_d (mpfr_ptr r, double d, mpfr_rnd_t rnd_mode) { int signd, inexact; unsigned int cnt; @@ -209,7 +209,7 @@ decimal64_to_string (char *s, _Decimal64 d) } int -mpfr_set_decimal64 (mpfr_ptr r, _Decimal64 d, mp_rnd_t rnd_mode) +mpfr_set_decimal64 (mpfr_ptr r, _Decimal64 d, mpfr_rnd_t rnd_mode) { char s[23]; /* need 1 character for sign, 16 characters for mantissa, @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mp_rnd_t rnd_mode) +mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mpfr_rnd_t rnd_mode) { mp_limb_t *my, *mx, *tmp; unsigned long cnt, sx, sy; @@ -49,7 +49,7 @@ static const struct { /* Generic code */ int -mpfr_set_ld (mpfr_ptr r, long double d, mp_rnd_t rnd_mode) +mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode) { mpfr_t t, u; int inexact, shift_exp; @@ -226,7 +226,7 @@ mpfr_set_ld (mpfr_ptr r, long double d, mp_rnd_t rnd_mode) #else /* IEEE Extended Little Endian Code */ int -mpfr_set_ld (mpfr_ptr r, long double d, mp_rnd_t rnd_mode) +mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode) { int inexact, i, k, cnt; mpfr_t tmp; @@ -62,7 +62,7 @@ set_z (mpfr_ptr f, mpz_srcptr z, mp_size_t *zs) /* set f to the rational q */ int -mpfr_set_q (mpfr_ptr f, mpq_srcptr q, mp_rnd_t rnd) +mpfr_set_q (mpfr_ptr f, mpq_srcptr q, mpfr_rnd_t rnd) { mpz_srcptr num, den; mpfr_t n, d; @@ -23,17 +23,17 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" -mp_rnd_t MPFR_THREAD_ATTR __gmpfr_default_rounding_mode = MPFR_RNDN; +mpfr_rnd_t MPFR_THREAD_ATTR __gmpfr_default_rounding_mode = MPFR_RNDN; void -mpfr_set_default_rounding_mode (mp_rnd_t rnd_mode) +mpfr_set_default_rounding_mode (mpfr_rnd_t rnd_mode) { if (rnd_mode >= MPFR_RNDN && rnd_mode < MPFR_RND_MAX) __gmpfr_default_rounding_mode = rnd_mode; } #undef mpfr_get_default_rounding_mode -mp_rnd_t +mpfr_rnd_t mpfr_get_default_rounding_mode (void) { return __gmpfr_default_rounding_mode; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #undef mpfr_set_si int -mpfr_set_si (mpfr_ptr x, long i, mp_rnd_t rnd_mode) +mpfr_set_si (mpfr_ptr x, long i, mpfr_rnd_t rnd_mode) { return mpfr_set_si_2exp (x, i, 0, rnd_mode); } diff --git a/set_si_2exp.c b/set_si_2exp.c index acfc48655..113eb2462 100644 --- a/set_si_2exp.c +++ b/set_si_2exp.c @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_set_si_2exp (mpfr_ptr x, long i, mp_exp_t e, mp_rnd_t rnd_mode) +mpfr_set_si_2exp (mpfr_ptr x, long i, mp_exp_t e, mpfr_rnd_t rnd_mode) { if (i == 0) { @@ -44,13 +44,13 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef _MPFR_H_HAVE_INTMAX_T int -mpfr_set_sj (mpfr_t x, intmax_t j, mp_rnd_t rnd) +mpfr_set_sj (mpfr_t x, intmax_t j, mpfr_rnd_t rnd) { return mpfr_set_sj_2exp (x, j, 0, rnd); } int -mpfr_set_sj_2exp (mpfr_t x, intmax_t j, intmax_t e, mp_rnd_t rnd) +mpfr_set_sj_2exp (mpfr_t x, intmax_t j, intmax_t e, mpfr_rnd_t rnd) { if (j>=0) return mpfr_set_uj_2exp (x, j, e, rnd); @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_set_str (mpfr_t x, const char *str, int base, mp_rnd_t rnd) +mpfr_set_str (mpfr_t x, const char *str, int base, mpfr_rnd_t rnd) { char *p; @@ -35,7 +35,7 @@ mpfr_set_str (mpfr_t x, const char *str, int base, mp_rnd_t rnd) int -mpfr_init_set_str (mpfr_ptr x, const char *str, int base, mp_rnd_t rnd) +mpfr_init_set_str (mpfr_ptr x, const char *str, int base, mpfr_rnd_t rnd) { mpfr_init (x); return mpfr_set_str (x, str, base, rnd); @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #undef mpfr_set_ui int -mpfr_set_ui (mpfr_ptr x, unsigned long i, mp_rnd_t rnd_mode) +mpfr_set_ui (mpfr_ptr x, unsigned long i, mpfr_rnd_t rnd_mode) { return mpfr_set_ui_2exp (x, i, 0, rnd_mode); } diff --git a/set_ui_2exp.c b/set_ui_2exp.c index 4bec85423..e8da895d0 100644 --- a/set_ui_2exp.c +++ b/set_ui_2exp.c @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_set_ui_2exp (mpfr_ptr x, unsigned long i, mp_exp_t e, mp_rnd_t rnd_mode) +mpfr_set_ui_2exp (mpfr_ptr x, unsigned long i, mp_exp_t e, mpfr_rnd_t rnd_mode) { MPFR_SET_POS (x); @@ -45,13 +45,13 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef _MPFR_H_HAVE_INTMAX_T int -mpfr_set_uj (mpfr_t x, uintmax_t j, mp_rnd_t rnd) +mpfr_set_uj (mpfr_t x, uintmax_t j, mpfr_rnd_t rnd) { return mpfr_set_uj_2exp (x, j, 0, rnd); } int -mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mp_rnd_t rnd) +mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mpfr_rnd_t rnd) { unsigned int cnt, i; mp_size_t k, len; @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* set f to the integer z */ int -mpfr_set_z (mpfr_ptr f, mpz_srcptr z, mp_rnd_t rnd_mode) +mpfr_set_z (mpfr_ptr f, mpz_srcptr z, mpfr_rnd_t rnd_mode) { mp_size_t fn, zn, dif; int k, sign_z, inex; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #undef mpfr_setsign int -mpfr_setsign (mpfr_ptr z, mpfr_srcptr x, int s, mp_rnd_t rnd_mode) +mpfr_setsign (mpfr_ptr z, mpfr_srcptr x, int s, mpfr_rnd_t rnd_mode) { return mpfr_set4 (z, x, rnd_mode, s ? -1 : 1); } @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_add_si (mpfr_ptr y, mpfr_srcptr x, long int u, mp_rnd_t rnd_mode) +mpfr_add_si (mpfr_ptr y, mpfr_srcptr x, long int u, mpfr_rnd_t rnd_mode) { if (u >= 0) return mpfr_add_ui (y, x, u, rnd_mode); @@ -34,7 +34,7 @@ mpfr_add_si (mpfr_ptr y, mpfr_srcptr x, long int u, mp_rnd_t rnd_mode) } int -mpfr_sub_si (mpfr_ptr y, mpfr_srcptr x, long int u, mp_rnd_t rnd_mode) +mpfr_sub_si (mpfr_ptr y, mpfr_srcptr x, long int u, mpfr_rnd_t rnd_mode) { if (u >= 0) return mpfr_sub_ui (y, x, u, rnd_mode); @@ -43,7 +43,7 @@ mpfr_sub_si (mpfr_ptr y, mpfr_srcptr x, long int u, mp_rnd_t rnd_mode) } int -mpfr_si_sub (mpfr_ptr y, long int u, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_si_sub (mpfr_ptr y, long int u, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { if (u >= 0) return mpfr_ui_sub (y, u, x, rnd_mode); @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t c, xr; mpfr_srcptr xx; @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* (y, z) <- (sin(x), cos(x)), return value is 0 iff both results are exact ie, iff x = 0 */ int -mpfr_sin_cos (mpfr_ptr y, mpfr_ptr z, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_sin_cos (mpfr_ptr y, mpfr_ptr z, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mp_prec_t prec, m; int neg, reduce; @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., sinh(x) = 1/2 [e^(x)-e^(-x)] */ int -mpfr_sinh (mpfr_ptr y, mpfr_srcptr xt, mp_rnd_t rnd_mode) +mpfr_sinh (mpfr_ptr y, mpfr_srcptr xt, mpfr_rnd_t rnd_mode) { mpfr_t x; int inexact; diff --git a/sinh_cosh.c b/sinh_cosh.c index eb842cbce..886441fdf 100644 --- a/sinh_cosh.c +++ b/sinh_cosh.c @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., Adapted from mpfr_sinh.c */ int -mpfr_sinh_cosh (mpfr_ptr sh, mpfr_ptr ch, mpfr_srcptr xt, mp_rnd_t rnd_mode) +mpfr_sinh_cosh (mpfr_ptr sh, mpfr_ptr ch, mpfr_srcptr xt, mpfr_rnd_t rnd_mode) { mpfr_t x; int inexact, inexact_sh, inexact_ch; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_sqr (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +mpfr_sqr (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int cc, inexact; mp_exp_t ax; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_sqrt (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode) +mpfr_sqrt (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) { mp_size_t rsize; /* number of limbs of r */ mp_size_t rrsize; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_sqrt_ui (mpfr_ptr r, unsigned long u, mp_rnd_t rnd_mode) +mpfr_sqrt_ui (mpfr_ptr r, unsigned long u, mpfr_rnd_t rnd_mode) { if (u) { @@ -436,7 +436,7 @@ parse_string (mpfr_t x, struct parsed_string *pstr, and the precision of x. Returns the ternary value. */ static int -parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mp_rnd_t rnd) +parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd) { mp_prec_t prec; mp_exp_t exp; @@ -780,7 +780,7 @@ free_parsed_string (struct parsed_string *pstr) int mpfr_strtofr (mpfr_t x, const char *string, char **end, int base, - mp_rnd_t rnd) + mpfr_rnd_t rnd) { int res; struct parsed_string pstr; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_sub (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_sub (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { MPFR_LOG_FUNC (("b[%#R]=%R c[%#R]=%R rnd=%d", b, b, c, c, rnd_mode), ("a[%#R]=%R", a, a)); @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int sign; mp_exp_unsigned_t diff_exp; @@ -28,8 +28,8 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef WANT_ASSERT # if WANT_ASSERT >= 2 -int mpfr_sub1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode); -int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +int mpfr_sub1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode); +int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mpfr_t tmpa, tmpb, tmpc; int inexb, inexc, inexact, inexact2; @@ -132,7 +132,7 @@ int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) */ int -mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mp_exp_t bx,cx; mp_exp_unsigned_t d; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_sub_d (mpfr_ptr a, mpfr_srcptr b, double c, mp_rnd_t rnd_mode) +mpfr_sub_d (mpfr_ptr a, mpfr_srcptr b, double c, mpfr_rnd_t rnd_mode) { int inexact; mpfr_t d; @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_sub_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) +mpfr_sub_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode) { if (MPFR_LIKELY (u != 0)) /* if u=0, do nothing */ { diff --git a/subnormal.c b/subnormal.c index e20b57343..8370e1b20 100644 --- a/subnormal.c +++ b/subnormal.c @@ -37,7 +37,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., */ int -mpfr_subnormalize (mpfr_ptr y, int old_inexact, mp_rnd_t rnd) +mpfr_subnormalize (mpfr_ptr y, int old_inexact, mpfr_rnd_t rnd) { int inexact = 0; @@ -237,7 +237,7 @@ sum_once (mpfr_ptr ret, mpfr_srcptr *const tab, unsigned long n, mp_prec_t F) */ int -mpfr_sum (mpfr_ptr ret, mpfr_ptr *const tab_p, unsigned long n, mp_rnd_t rnd) +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; @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* computes tan(x) = sign(x)*sqrt(1/cos(x)^2-1) */ int -mpfr_tan (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_tan (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mp_prec_t precy, m; int inexact; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_tanh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode) +mpfr_tanh (mpfr_ptr y, mpfr_srcptr xt , mpfr_rnd_t rnd_mode) { /****** Declaration ******/ mpfr_t x; diff --git a/tests/cmp_str.c b/tests/cmp_str.c index ee8b1960f..b791f6995 100644 --- a/tests/cmp_str.c +++ b/tests/cmp_str.c @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-test.h" int -mpfr_cmp_str (mpfr_srcptr x, const char *s, int base, mp_rnd_t rnd) +mpfr_cmp_str (mpfr_srcptr x, const char *s, int base, mpfr_rnd_t rnd) { mpfr_t y; int res; diff --git a/tests/mpfr-test.h b/tests/mpfr-test.h index 356f6be3f..2264b9264 100644 --- a/tests/mpfr-test.h +++ b/tests/mpfr-test.h @@ -35,7 +35,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define MAXNORM 1.7976931348623157081e308 /* 2^(1023)*(2-2^(-52)) */ /* Generates a random rounding mode */ -#define RND_RAND() ((mp_rnd_t) (randlimb() % MPFR_RND_MAX)) +#define RND_RAND() ((mpfr_rnd_t) (randlimb() % MPFR_RND_MAX)) /* Generates a random sign */ #define SIGN_RAND() ( (randlimb()%2) ? MPFR_SIGN_POS : MPFR_SIGN_NEG) @@ -54,7 +54,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define ABS(x) (((x)>0) ? (x) : -(x)) -#define FLIST mpfr_ptr, mpfr_srcptr, mp_rnd_t +#define FLIST mpfr_ptr, mpfr_srcptr, mpfr_rnd_t #if defined (__cplusplus) extern "C" { @@ -68,7 +68,7 @@ void tests_memory_end _MPFR_PROTO ((void)); void tests_start_mpfr _MPFR_PROTO ((void)); void tests_end_mpfr _MPFR_PROTO ((void)); -int mpfr_set_machine_rnd_mode _MPFR_PROTO ((mp_rnd_t)); +int mpfr_set_machine_rnd_mode _MPFR_PROTO ((mpfr_rnd_t)); void mpfr_test_init _MPFR_PROTO ((void)); mp_limb_t randlimb _MPFR_PROTO ((void)); void randseed _MPFR_PROTO ((unsigned int)); @@ -89,7 +89,7 @@ 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)); -int mpfr_cmp_str _MPFR_PROTO ((mpfr_srcptr x, const char *, int, mp_rnd_t)); +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) #define mpfr_set_str1(x,s) mpfr_set_str(x,s,10,MPFR_RNDN) diff --git a/tests/reuse.c b/tests/reuse.c index 8b41fb46e..c4f92f9dc 100644 --- a/tests/reuse.c +++ b/tests/reuse.c @@ -88,8 +88,8 @@ mpfr_compare (mpfr_srcptr a, mpfr_srcptr b) } static void -test3 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mp_rnd_t), - char *foo, mp_prec_t prec, mp_rnd_t rnd) +test3 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t), + char *foo, mp_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref2, ref3; mpfr_t res1; @@ -159,8 +159,8 @@ test3 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mp_rnd_t), static void test4 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, - mp_rnd_t), - char *foo, mp_prec_t prec, mp_rnd_t rnd) + mpfr_rnd_t), + char *foo, mp_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref, op1, op2, op3; mpfr_t res; @@ -287,8 +287,8 @@ test4 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, } static void -test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mp_rnd_t), - char *foo, mp_prec_t prec, mp_rnd_t rnd) +test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mpfr_rnd_t), + char *foo, mp_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref2; unsigned int ref3; @@ -332,8 +332,8 @@ test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mp_rnd_t), } static void -testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mp_rnd_t), - char *foo, mp_prec_t prec, mp_rnd_t rnd) +testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mpfr_rnd_t), + char *foo, mp_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref3; unsigned int ref2; @@ -373,8 +373,8 @@ testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mp_rnd_t), /* foo(mpfr_ptr, mpfr_srcptr, mp_rndt) */ static void -test2 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mp_rnd_t), - char *foo, mp_prec_t prec, mp_rnd_t rnd) +test2 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_rnd_t), + char *foo, mp_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref2; mpfr_t res1; @@ -453,8 +453,8 @@ test2a (int (*testfunc)(mpfr_ptr, mpfr_srcptr), /* one operand, two results */ static void -test3a (int (*testfunc)(mpfr_ptr, mpfr_ptr, mpfr_srcptr, mp_rnd_t), - char *foo, mp_prec_t prec, mp_rnd_t rnd) +test3a (int (*testfunc)(mpfr_ptr, mpfr_ptr, mpfr_srcptr, mpfr_rnd_t), + char *foo, mp_prec_t prec, mpfr_rnd_t rnd) { mpfr_t ref1, ref2, ref3; mpfr_t res1, res2; @@ -510,7 +510,7 @@ test3a (int (*testfunc)(mpfr_ptr, mpfr_ptr, mpfr_srcptr, mp_rnd_t), } static int -reldiff_wrapper (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +reldiff_wrapper (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { mpfr_reldiff (a, b, c, rnd_mode); return 0; @@ -531,99 +531,99 @@ main (void) test2a (mpfr_floor, "mpfr_floor", p); test2a (mpfr_trunc, "mpfr_trunc", p); - test2ui (mpfr_add_ui, "mpfr_add_ui", p, (mp_rnd_t) rnd); - test2ui (mpfr_div_2exp, "mpfr_div_2exp", p, (mp_rnd_t) rnd); - test2ui (mpfr_div_ui, "mpfr_div_ui", p, (mp_rnd_t) rnd); - test2ui (mpfr_mul_2exp, "mpfr_mul_2exp", p, (mp_rnd_t) rnd); - test2ui (mpfr_mul_ui, "mpfr_mul_ui", p, (mp_rnd_t) rnd); - test2ui (mpfr_pow_ui, "mpfr_pow_ui", p, (mp_rnd_t) rnd); - test2ui (mpfr_sub_ui, "mpfr_sub_ui", p, (mp_rnd_t) rnd); - - testui2 (mpfr_ui_div, "mpfr_ui_div", p, (mp_rnd_t) rnd); - testui2 (mpfr_ui_sub, "mpfr_ui_sub", p, (mp_rnd_t) rnd); - testui2 (mpfr_ui_pow, "mpfr_ui_pow", p, (mp_rnd_t) rnd); - - test2 (mpfr_sqr, "mpfr_sqr", p, (mp_rnd_t) rnd); - test2 (mpfr_sqrt, "mpfr_sqrt", p, (mp_rnd_t) rnd); - test2 (mpfr_abs, "mpfr_abs", p, (mp_rnd_t) rnd); - test2 (mpfr_neg, "mpfr_neg", p, (mp_rnd_t) rnd); - - test2 (mpfr_log, "mpfr_log", p, (mp_rnd_t) rnd); - test2 (mpfr_log2, "mpfr_log2", p, (mp_rnd_t) rnd); - test2 (mpfr_log10, "mpfr_log10", p, (mp_rnd_t) rnd); - test2 (mpfr_log1p, "mpfr_log1p", p, (mp_rnd_t) rnd); - - test2 (mpfr_exp, "mpfr_exp", p, (mp_rnd_t) rnd); - test2 (mpfr_exp2, "mpfr_exp2", p, (mp_rnd_t) rnd); - test2 (mpfr_exp10, "mpfr_exp10", p, (mp_rnd_t) rnd); - test2 (mpfr_expm1, "mpfr_expm1", p, (mp_rnd_t) rnd); - test2 (mpfr_eint, "mpfr_eint", p, (mp_rnd_t) rnd); - - test2 (mpfr_sinh, "mpfr_sinh", p, (mp_rnd_t) rnd); - test2 (mpfr_cosh, "mpfr_cosh", p, (mp_rnd_t) rnd); - test2 (mpfr_tanh, "mpfr_tanh", p, (mp_rnd_t) rnd); - test2 (mpfr_asinh, "mpfr_asinh", p, (mp_rnd_t) rnd); - test2 (mpfr_acosh, "mpfr_acosh", p, (mp_rnd_t) rnd); - test2 (mpfr_atanh, "mpfr_atanh", p, (mp_rnd_t) rnd); - test2 (mpfr_sech, "mpfr_sech", p, (mp_rnd_t) rnd); - test2 (mpfr_csch, "mpfr_csch", p, (mp_rnd_t) rnd); - test2 (mpfr_coth, "mpfr_coth", p, (mp_rnd_t) rnd); - - test2 (mpfr_asin, "mpfr_asin", p, (mp_rnd_t) rnd); - test2 (mpfr_acos, "mpfr_acos", p, (mp_rnd_t) rnd); - test2 (mpfr_atan, "mpfr_atan", p, (mp_rnd_t) rnd); - test2 (mpfr_cos, "mpfr_cos", p, (mp_rnd_t) rnd); - test2 (mpfr_sin, "mpfr_sin", p, (mp_rnd_t) rnd); - test2 (mpfr_tan, "mpfr_tan", p, (mp_rnd_t) rnd); - test2 (mpfr_sec, "mpfr_sec", p, (mp_rnd_t) rnd); - test2 (mpfr_csc, "mpfr_csc", p, (mp_rnd_t) rnd); - test2 (mpfr_cot, "mpfr_cot", p, (mp_rnd_t) rnd); - - test2 (mpfr_erf, "mpfr_erf", p, (mp_rnd_t) rnd); - test2 (mpfr_erfc, "mpfr_erfc", p, (mp_rnd_t) rnd); - test2 (mpfr_j0, "mpfr_j0", p, (mp_rnd_t) rnd); - test2 (mpfr_j1, "mpfr_j1", p, (mp_rnd_t) rnd); - test2 (mpfr_y0, "mpfr_y0", p, (mp_rnd_t) rnd); - test2 (mpfr_y1, "mpfr_y1", p, (mp_rnd_t) rnd); - test2 (mpfr_zeta, "mpfr_zeta", p, (mp_rnd_t) rnd); - test2 (mpfr_gamma, "mpfr_gamma", p, (mp_rnd_t) rnd); - test2 (mpfr_lngamma, "mpfr_lngamma", p, (mp_rnd_t) rnd); - - test2 (mpfr_rint, "mpfr_rint", p, (mp_rnd_t) rnd); - test2 (mpfr_rint_ceil, "mpfr_rint_ceil", p, (mp_rnd_t) rnd); - test2 (mpfr_rint_floor, "mpfr_rint_floor", p, (mp_rnd_t) rnd); - test2 (mpfr_rint_round, "mpfr_rint_round", p, (mp_rnd_t) rnd); - test2 (mpfr_rint_trunc, "mpfr_rint_trunc", p, (mp_rnd_t) rnd); - test2 (mpfr_frac, "mpfr_frac", p, (mp_rnd_t) rnd); - - test3 (mpfr_add, "mpfr_add", p, (mp_rnd_t) rnd); - test3 (mpfr_sub, "mpfr_sub", p, (mp_rnd_t) rnd); - test3 (mpfr_mul, "mpfr_mul", p, (mp_rnd_t) rnd); - test3 (mpfr_div, "mpfr_div", p, (mp_rnd_t) rnd); - - test3 (mpfr_agm, "mpfr_agm", p, (mp_rnd_t) rnd); - test3 (mpfr_min, "mpfr_min", p, (mp_rnd_t) rnd); - test3 (mpfr_max, "mpfr_max", p, (mp_rnd_t) rnd); - - test3 (reldiff_wrapper, "mpfr_reldiff", p, (mp_rnd_t) rnd); - test3 (mpfr_dim, "mpfr_dim", p, (mp_rnd_t) rnd); - - test3 (mpfr_remainder, "mpfr_remainder", p, (mp_rnd_t) rnd); - test3 (mpfr_pow, "mpfr_pow", p, (mp_rnd_t) rnd); - test3 (mpfr_atan2, "mpfr_atan2", p, (mp_rnd_t) rnd); - test3 (mpfr_hypot, "mpfr_hypot", p, (mp_rnd_t) rnd); - - test3a (mpfr_sin_cos, "mpfr_sin_cos", p, (mp_rnd_t) rnd); - - test4 (mpfr_fma, "mpfr_fma", p, (mp_rnd_t) rnd); - test4 (mpfr_fms, "mpfr_fms", p, (mp_rnd_t) rnd); + test2ui (mpfr_add_ui, "mpfr_add_ui", p, (mpfr_rnd_t) rnd); + test2ui (mpfr_div_2exp, "mpfr_div_2exp", p, (mpfr_rnd_t) rnd); + test2ui (mpfr_div_ui, "mpfr_div_ui", p, (mpfr_rnd_t) rnd); + test2ui (mpfr_mul_2exp, "mpfr_mul_2exp", p, (mpfr_rnd_t) rnd); + test2ui (mpfr_mul_ui, "mpfr_mul_ui", p, (mpfr_rnd_t) rnd); + test2ui (mpfr_pow_ui, "mpfr_pow_ui", p, (mpfr_rnd_t) rnd); + test2ui (mpfr_sub_ui, "mpfr_sub_ui", p, (mpfr_rnd_t) rnd); + + testui2 (mpfr_ui_div, "mpfr_ui_div", p, (mpfr_rnd_t) rnd); + testui2 (mpfr_ui_sub, "mpfr_ui_sub", p, (mpfr_rnd_t) rnd); + testui2 (mpfr_ui_pow, "mpfr_ui_pow", p, (mpfr_rnd_t) rnd); + + test2 (mpfr_sqr, "mpfr_sqr", p, (mpfr_rnd_t) rnd); + test2 (mpfr_sqrt, "mpfr_sqrt", p, (mpfr_rnd_t) rnd); + test2 (mpfr_abs, "mpfr_abs", p, (mpfr_rnd_t) rnd); + test2 (mpfr_neg, "mpfr_neg", p, (mpfr_rnd_t) rnd); + + test2 (mpfr_log, "mpfr_log", p, (mpfr_rnd_t) rnd); + test2 (mpfr_log2, "mpfr_log2", p, (mpfr_rnd_t) rnd); + test2 (mpfr_log10, "mpfr_log10", p, (mpfr_rnd_t) rnd); + test2 (mpfr_log1p, "mpfr_log1p", p, (mpfr_rnd_t) rnd); + + test2 (mpfr_exp, "mpfr_exp", p, (mpfr_rnd_t) rnd); + test2 (mpfr_exp2, "mpfr_exp2", p, (mpfr_rnd_t) rnd); + test2 (mpfr_exp10, "mpfr_exp10", p, (mpfr_rnd_t) rnd); + test2 (mpfr_expm1, "mpfr_expm1", p, (mpfr_rnd_t) rnd); + test2 (mpfr_eint, "mpfr_eint", p, (mpfr_rnd_t) rnd); + + test2 (mpfr_sinh, "mpfr_sinh", p, (mpfr_rnd_t) rnd); + test2 (mpfr_cosh, "mpfr_cosh", p, (mpfr_rnd_t) rnd); + test2 (mpfr_tanh, "mpfr_tanh", p, (mpfr_rnd_t) rnd); + test2 (mpfr_asinh, "mpfr_asinh", p, (mpfr_rnd_t) rnd); + test2 (mpfr_acosh, "mpfr_acosh", p, (mpfr_rnd_t) rnd); + test2 (mpfr_atanh, "mpfr_atanh", p, (mpfr_rnd_t) rnd); + test2 (mpfr_sech, "mpfr_sech", p, (mpfr_rnd_t) rnd); + test2 (mpfr_csch, "mpfr_csch", p, (mpfr_rnd_t) rnd); + test2 (mpfr_coth, "mpfr_coth", p, (mpfr_rnd_t) rnd); + + test2 (mpfr_asin, "mpfr_asin", p, (mpfr_rnd_t) rnd); + test2 (mpfr_acos, "mpfr_acos", p, (mpfr_rnd_t) rnd); + test2 (mpfr_atan, "mpfr_atan", p, (mpfr_rnd_t) rnd); + test2 (mpfr_cos, "mpfr_cos", p, (mpfr_rnd_t) rnd); + test2 (mpfr_sin, "mpfr_sin", p, (mpfr_rnd_t) rnd); + test2 (mpfr_tan, "mpfr_tan", p, (mpfr_rnd_t) rnd); + test2 (mpfr_sec, "mpfr_sec", p, (mpfr_rnd_t) rnd); + test2 (mpfr_csc, "mpfr_csc", p, (mpfr_rnd_t) rnd); + test2 (mpfr_cot, "mpfr_cot", p, (mpfr_rnd_t) rnd); + + test2 (mpfr_erf, "mpfr_erf", p, (mpfr_rnd_t) rnd); + test2 (mpfr_erfc, "mpfr_erfc", p, (mpfr_rnd_t) rnd); + test2 (mpfr_j0, "mpfr_j0", p, (mpfr_rnd_t) rnd); + test2 (mpfr_j1, "mpfr_j1", p, (mpfr_rnd_t) rnd); + test2 (mpfr_y0, "mpfr_y0", p, (mpfr_rnd_t) rnd); + test2 (mpfr_y1, "mpfr_y1", p, (mpfr_rnd_t) rnd); + test2 (mpfr_zeta, "mpfr_zeta", p, (mpfr_rnd_t) rnd); + test2 (mpfr_gamma, "mpfr_gamma", p, (mpfr_rnd_t) rnd); + test2 (mpfr_lngamma, "mpfr_lngamma", p, (mpfr_rnd_t) rnd); + + test2 (mpfr_rint, "mpfr_rint", p, (mpfr_rnd_t) rnd); + test2 (mpfr_rint_ceil, "mpfr_rint_ceil", p, (mpfr_rnd_t) rnd); + test2 (mpfr_rint_floor, "mpfr_rint_floor", p, (mpfr_rnd_t) rnd); + test2 (mpfr_rint_round, "mpfr_rint_round", p, (mpfr_rnd_t) rnd); + test2 (mpfr_rint_trunc, "mpfr_rint_trunc", p, (mpfr_rnd_t) rnd); + test2 (mpfr_frac, "mpfr_frac", p, (mpfr_rnd_t) rnd); + + test3 (mpfr_add, "mpfr_add", p, (mpfr_rnd_t) rnd); + test3 (mpfr_sub, "mpfr_sub", p, (mpfr_rnd_t) rnd); + test3 (mpfr_mul, "mpfr_mul", p, (mpfr_rnd_t) rnd); + test3 (mpfr_div, "mpfr_div", p, (mpfr_rnd_t) rnd); + + test3 (mpfr_agm, "mpfr_agm", p, (mpfr_rnd_t) rnd); + test3 (mpfr_min, "mpfr_min", p, (mpfr_rnd_t) rnd); + test3 (mpfr_max, "mpfr_max", p, (mpfr_rnd_t) rnd); + + test3 (reldiff_wrapper, "mpfr_reldiff", p, (mpfr_rnd_t) rnd); + test3 (mpfr_dim, "mpfr_dim", p, (mpfr_rnd_t) rnd); + + test3 (mpfr_remainder, "mpfr_remainder", p, (mpfr_rnd_t) rnd); + test3 (mpfr_pow, "mpfr_pow", p, (mpfr_rnd_t) rnd); + test3 (mpfr_atan2, "mpfr_atan2", p, (mpfr_rnd_t) rnd); + test3 (mpfr_hypot, "mpfr_hypot", p, (mpfr_rnd_t) rnd); + + test3a (mpfr_sin_cos, "mpfr_sin_cos", p, (mpfr_rnd_t) rnd); + + test4 (mpfr_fma, "mpfr_fma", p, (mpfr_rnd_t) rnd); + test4 (mpfr_fms, "mpfr_fms", p, (mpfr_rnd_t) rnd); #if MPFR_VERSION >= MPFR_VERSION_NUM(2,4,0) - test2 (mpfr_li2, "mpfr_li2", p, (mp_rnd_t) rnd); - test2 (mpfr_rec_sqrt, "mpfr_rec_sqrt", p, (mp_rnd_t) rnd); - test3 (mpfr_fmod, "mpfr_fmod", p, (mp_rnd_t) rnd); - test3a (mpfr_modf, "mpfr_modf", p, (mp_rnd_t) rnd); - test3a (mpfr_sinh_cosh, "mpfr_sinh_cosh", p, (mp_rnd_t) rnd); + test2 (mpfr_li2, "mpfr_li2", p, (mpfr_rnd_t) rnd); + test2 (mpfr_rec_sqrt, "mpfr_rec_sqrt", p, (mpfr_rnd_t) rnd); + test3 (mpfr_fmod, "mpfr_fmod", p, (mpfr_rnd_t) rnd); + test3a (mpfr_modf, "mpfr_modf", p, (mpfr_rnd_t) rnd); + test3a (mpfr_sinh_cosh, "mpfr_sinh_cosh", p, (mpfr_rnd_t) rnd); #endif } diff --git a/tests/rnd_mode.c b/tests/rnd_mode.c index 178e12226..ed0001e92 100644 --- a/tests/rnd_mode.c +++ b/tests/rnd_mode.c @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* sets the machine rounding mode to the value rnd_mode */ int -mpfr_set_machine_rnd_mode (mp_rnd_t rnd_mode) +mpfr_set_machine_rnd_mode (mpfr_rnd_t rnd_mode) { switch (rnd_mode) { diff --git a/tests/tabs.c b/tests/tabs.c index 8af0216fc..e1d72cae4 100644 --- a/tests/tabs.c +++ b/tests/tabs.c @@ -55,7 +55,7 @@ check_inexact (void) mpfr_set_prec (y, q); RND_LOOP (rnd) { - inexact = mpfr_abs (y, x, (mp_rnd_t) rnd); + inexact = mpfr_abs (y, x, (mpfr_rnd_t) rnd); cmp = mpfr_cmp (y, absx); if (((inexact == 0) && (cmp != 0)) || ((inexact > 0) && (cmp <= 0)) || @@ -135,7 +135,7 @@ check_cmp (int argc, char *argv[]) n = (argc==1) ? 25000 : atoi(argv[1]); for (k = 1; k <= n; k++) { - mp_rnd_t rnd; + mpfr_rnd_t rnd; int sign = SIGN_RAND (); mpfr_urandomb (x, RANDS); diff --git a/tests/tacos.c b/tests/tacos.c index 2eb99e742..65bc6f50b 100644 --- a/tests/tacos.c +++ b/tests/tacos.c @@ -149,13 +149,13 @@ main (void) for (r = 0; r < MPFR_RND_MAX; r++) { mpfr_set_ui (x, 0, MPFR_RNDN); /* exact */ - mpfr_acos (y, x, (mp_rnd_t) r); - mpfr_const_pi (x, (mp_rnd_t) r); + mpfr_acos (y, x, (mpfr_rnd_t) r); + mpfr_const_pi (x, (mpfr_rnd_t) r); mpfr_div_2exp (x, x, 1, MPFR_RNDN); /* exact */ if (mpfr_cmp (x, y)) { printf ("Error: acos(0) != Pi/2 for rnd=%s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } } @@ -164,12 +164,12 @@ main (void) for (r = 0; r < MPFR_RND_MAX; r++) { mpfr_set_si (x, -1, MPFR_RNDN); /* exact */ - mpfr_acos (y, x, (mp_rnd_t) r); - mpfr_const_pi (x, (mp_rnd_t) r); + mpfr_acos (y, x, (mpfr_rnd_t) r); + mpfr_const_pi (x, (mpfr_rnd_t) r); if (mpfr_cmp (x, y)) { printf ("Error: acos(1) != Pi for rnd=%s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } } diff --git a/tests/tadd.c b/tests/tadd.c index 9523b0695..5dcd914d0 100644 --- a/tests/tadd.c +++ b/tests/tadd.c @@ -34,7 +34,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static int usesp; static int -test_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +test_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int res; #ifdef CHECK_EXTERNAL @@ -78,7 +78,7 @@ test_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) /* checks that x+y gives the right result with 53 bits of precision */ static void -pcheck (const char *xs, const char *ys, const char *zs, mp_rnd_t rnd_mode, +pcheck (const char *xs, const char *ys, const char *zs, mpfr_rnd_t rnd_mode, unsigned int px, unsigned int py, unsigned int pz) { mpfr_t xx,yy,zz; @@ -105,7 +105,7 @@ static void check2b (const char *xs, int px, const char *ys, int py, const char *rs, int pz, - mp_rnd_t rnd_mode) + mpfr_rnd_t rnd_mode) { mpfr_t xx, yy, zz; @@ -477,7 +477,7 @@ check_inexact (void) mpfr_t x, y, z, u; mp_prec_t px, py, pu, pz; int inexact, cmp; - mp_rnd_t rnd; + mpfr_rnd_t rnd; mpfr_init (x); mpfr_init (y); @@ -651,7 +651,7 @@ check_overflow (void) { mpfr_set_prec (a, prec_a); mpfr_clear_overflow (); - test_add (a, b, c, (mp_rnd_t) r); + test_add (a, b, c, (mpfr_rnd_t) r); if (!mpfr_overflow_p ()) { printf ("No overflow in check_overflow\n"); @@ -690,7 +690,7 @@ check_1111 (void) int m = 512; int sb, sc; int inex_a, inex_s; - mp_rnd_t rnd_mode; + mpfr_rnd_t rnd_mode; prec_a = MPFR_PREC_MIN + (randlimb () % m); prec_b = MPFR_PREC_MIN + (randlimb () % m); @@ -789,7 +789,7 @@ check_1minuseps (void) mpfr_set_ui (c, 1, MPFR_RNDN); mpfr_div_ui (c, c, prec_a[ia] + supp_b[ic], MPFR_RNDN); - inex_a = test_add (a, b, c, (mp_rnd_t) rnd_mode); + inex_a = test_add (a, b, c, (mpfr_rnd_t) rnd_mode); mpfr_init2 (s, 256); inex_s = test_add (s, b, c, MPFR_RNDN); /* exact */ if (inex_s) @@ -798,7 +798,7 @@ check_1minuseps (void) "(ia = %u, ib = %u, ic = %u)\n", ia, ib, ic); exit (1); } - inex_s = mpfr_prec_round (s, prec_a[ia], (mp_rnd_t) rnd_mode); + inex_s = mpfr_prec_round (s, prec_a[ia], (mpfr_rnd_t) rnd_mode); if ((inex_a < 0 && inex_s >= 0) || (inex_a == 0 && inex_s != 0) || (inex_a > 0 && inex_s <= 0) || diff --git a/tests/tadd1sp.c b/tests/tadd1sp.c index 60fa56367..f80392680 100644 --- a/tests/tadd1sp.c +++ b/tests/tadd1sp.c @@ -76,7 +76,7 @@ main (void) #define STD_ERROR \ {\ printf("ERROR: for %s and p=%lu and i=%d:\nB=",\ - mpfr_print_rnd_mode ((mp_rnd_t) r), p, i);\ + mpfr_print_rnd_mode ((mpfr_rnd_t) r), p, i);\ mpfr_print_binary(b);\ printf("\nC="); mpfr_print_binary(c);\ printf("\nadd1 : "); mpfr_print_binary(a1);\ @@ -88,7 +88,7 @@ main (void) #define STD_ERROR2 \ {\ printf("ERROR: Wrong inexact flag for %s and p=%lu and i=%d:\nB=",\ - mpfr_print_rnd_mode ((mp_rnd_t) r), p, i);\ + mpfr_print_rnd_mode ((mpfr_rnd_t) r), p, i);\ mpfr_print_binary(b);\ printf("\nC="); mpfr_print_binary(c);\ printf("\nA="); mpfr_print_binary(a1);\ @@ -124,8 +124,8 @@ check_random (mp_prec_t p) if (MPFR_IS_PURE_FP(b) && MPFR_IS_PURE_FP(c)) for (r = 0 ; r < MPFR_RND_MAX ; r++) { - inexact1 = mpfr_add1(a1, b, c, (mp_rnd_t) r); - inexact2 = mpfr_add1sp(a2, b, c, (mp_rnd_t) r); + inexact1 = mpfr_add1(a1, b, c, (mpfr_rnd_t) r); + inexact2 = mpfr_add1sp(a2, b, c, (mpfr_rnd_t) r); if (mpfr_cmp(a1, a2)) STD_ERROR; if (inexact1 != inexact2) @@ -152,16 +152,16 @@ check_special (void) SET_PREC(53); mpfr_set_str1 (b, "1@100"); mpfr_set_str1 (c, "1@1"); - inexact1 = mpfr_add1(a1, b, c, (mp_rnd_t) r); - inexact2 = mpfr_add1sp(a2, b, c, (mp_rnd_t) r); + inexact1 = mpfr_add1(a1, b, c, (mpfr_rnd_t) r); + inexact2 = mpfr_add1sp(a2, b, c, (mpfr_rnd_t) r); if (mpfr_cmp(a1, a2)) STD_ERROR; if (inexact1 != inexact2) STD_ERROR2; mpfr_set_str_binary (b, "1E53"); mpfr_set_str_binary (c, "1E0"); - inexact1 = mpfr_add1(a1, b, c, (mp_rnd_t) r); - inexact2 = mpfr_add1sp(a2, b, c, (mp_rnd_t) r); + inexact1 = mpfr_add1(a1, b, c, (mpfr_rnd_t) r); + inexact2 = mpfr_add1sp(a2, b, c, (mpfr_rnd_t) r); if (mpfr_cmp(a1, a2)) STD_ERROR; if (inexact1 != inexact2) diff --git a/tests/tadd_ui.c b/tests/tadd_ui.c index 8c2428c45..27c51ef05 100644 --- a/tests/tadd_ui.c +++ b/tests/tadd_ui.c @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* checks that x+y gives the right results with 53 bits of precision */ static void -check3 (const char *xs, unsigned long y, mp_rnd_t rnd_mode, const char *zs) +check3 (const char *xs, unsigned long y, mpfr_rnd_t rnd_mode, const char *zs) { mpfr_t xx, zz; diff --git a/tests/tagm.c b/tests/tagm.c index 6d1d5aee6..bd59477a4 100644 --- a/tests/tagm.c +++ b/tests/tagm.c @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define check(a,b,r) check4(a,b,r,0.0) static void -check4 (const char *as, const char *bs, mp_rnd_t rnd_mode, const char *res) +check4 (const char *as, const char *bs, mpfr_rnd_t rnd_mode, const char *res) { mpfr_t ta, tb, tres; diff --git a/tests/tasin.c b/tests/tasin.c index b27b343a0..b92571316 100644 --- a/tests/tasin.c +++ b/tests/tasin.c @@ -99,13 +99,13 @@ special (void) for (r = 0; r < MPFR_RND_MAX; r++) { mpfr_set_ui (x, 1, MPFR_RNDN); /* exact */ - mpfr_asin (y, x, (mp_rnd_t) r); - mpfr_const_pi (x, (mp_rnd_t) r); + mpfr_asin (y, x, (mpfr_rnd_t) r); + mpfr_const_pi (x, (mpfr_rnd_t) r); mpfr_div_2exp (x, x, 1, MPFR_RNDN); /* exact */ if (mpfr_cmp (x, y)) { printf ("Error: asin(1) != Pi/2 for rnd=%s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } } @@ -114,14 +114,14 @@ special (void) for (r = 0; r < MPFR_RND_MAX; r++) { mpfr_set_si (x, -1, MPFR_RNDN); /* exact */ - mpfr_asin (y, x, (mp_rnd_t) r); - mpfr_const_pi (x, MPFR_INVERT_RND((mp_rnd_t) r)); + mpfr_asin (y, x, (mpfr_rnd_t) r); + mpfr_const_pi (x, MPFR_INVERT_RND((mpfr_rnd_t) r)); mpfr_neg (x, x, MPFR_RNDN); /* exact */ mpfr_div_2exp (x, x, 1, MPFR_RNDN); /* exact */ if (mpfr_cmp (x, y)) { printf ("Error: asin(-1) != -Pi/2 for rnd=%s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } } diff --git a/tests/tatan.c b/tests/tatan.c index bbf3a6956..795b300fe 100644 --- a/tests/tatan.c +++ b/tests/tatan.c @@ -56,13 +56,13 @@ special (void) for (r = 0; r < MPFR_RND_MAX ; r++) { mpfr_set_inf (x, 1); - mpfr_atan (y, x, (mp_rnd_t) r); - mpfr_const_pi (x, (mp_rnd_t) r); - mpfr_div_2exp (x, x, 1, (mp_rnd_t) r); + mpfr_atan (y, x, (mpfr_rnd_t) r); + mpfr_const_pi (x, (mpfr_rnd_t) r); + mpfr_div_2exp (x, x, 1, (mpfr_rnd_t) r); if (mpfr_cmp (x, y)) { printf ("Error: mpfr_atan(+Inf), rnd=%s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } } @@ -71,14 +71,14 @@ special (void) for (r = 0; r < MPFR_RND_MAX ; r++) { mpfr_set_inf (x, -1); - mpfr_atan (y, x, (mp_rnd_t) r); - mpfr_const_pi (x, MPFR_INVERT_RND((mp_rnd_t) r)); - mpfr_neg (x, x, (mp_rnd_t) r); - mpfr_div_2exp (x, x, 1, (mp_rnd_t) r); + mpfr_atan (y, x, (mpfr_rnd_t) r); + mpfr_const_pi (x, MPFR_INVERT_RND((mpfr_rnd_t) r)); + mpfr_neg (x, x, (mpfr_rnd_t) r); + mpfr_div_2exp (x, x, 1, (mpfr_rnd_t) r); if (mpfr_cmp (x, y)) { printf ("Error: mpfr_atan(-Inf), rnd=%s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } } diff --git a/tests/taway.c b/tests/taway.c index ecadcf688..0f8ceb840 100644 --- a/tests/taway.c +++ b/tests/taway.c @@ -89,14 +89,14 @@ mpfr_compare (mpfr_srcptr a, mpfr_srcptr b) } static void -test3 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mp_rnd_t), +test3 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t), char *foo) { mpfr_t ref1, ref2, ref3; mpfr_t res1; mp_prec_t p1, p2, p3; int i, inexa, inexd; - mp_rnd_t r; + mpfr_rnd_t r; p1 = (randlimb () % 200) + MPFR_PREC_MIN; p2 = (randlimb () % 200) + MPFR_PREC_MIN; @@ -137,13 +137,13 @@ test3 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mp_rnd_t), static void test4 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, - mp_rnd_t), char *foo) + mpfr_rnd_t), char *foo) { mpfr_t ref, op1, op2, op3; mp_prec_t pout, p1, p2, p3; mpfr_t res; int i, j, k, inexa, inexd; - mp_rnd_t r; + mpfr_rnd_t r; pout = (randlimb () % 200) + MPFR_PREC_MIN; p1 = (randlimb () % 200) + MPFR_PREC_MIN; @@ -193,7 +193,7 @@ test4 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, } static void -test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mp_rnd_t), +test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mpfr_rnd_t), char *foo) { mpfr_t ref1, ref2; @@ -201,7 +201,7 @@ test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mp_rnd_t), mpfr_t res1; mp_prec_t p1, p2; int i, inexa, inexd; - mp_rnd_t r; + mpfr_rnd_t r; p1 = (randlimb () % 200) + MPFR_PREC_MIN; p2 = (randlimb () % 200) + MPFR_PREC_MIN; @@ -238,7 +238,7 @@ test2ui (int (*testfunc)(mpfr_ptr, mpfr_srcptr, unsigned long int, mp_rnd_t), } static void -testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mp_rnd_t), +testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mpfr_rnd_t), char *foo) { mpfr_t ref1, ref3; @@ -246,7 +246,7 @@ testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mp_rnd_t), mpfr_t res1; mp_prec_t p1, p3; int i, inexa, inexd; - mp_rnd_t r; + mpfr_rnd_t r; p1 = (randlimb () % 200) + MPFR_PREC_MIN; p3 = (randlimb () % 200) + MPFR_PREC_MIN; @@ -281,13 +281,13 @@ testui2 (int (*testfunc)(mpfr_ptr, unsigned long int, mpfr_srcptr, mp_rnd_t), /* foo(mpfr_ptr, mpfr_srcptr, mp_rndt) */ static void -test2 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mp_rnd_t), char *foo) +test2 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mpfr_rnd_t), char *foo) { mpfr_t ref1, ref2; mpfr_t res1; mp_prec_t p1, p2; int i, inexa, inexd; - mp_rnd_t r; + mpfr_rnd_t r; p1 = (randlimb () % 200) + MPFR_PREC_MIN; p2 = (randlimb () % 200) + MPFR_PREC_MIN; @@ -322,13 +322,13 @@ test2 (int (*testfunc)(mpfr_ptr, mpfr_srcptr, mp_rnd_t), char *foo) /* one operand, two results, like mpfr_sin_cos */ static void -test3a (int (*testfunc)(mpfr_ptr, mpfr_ptr, mpfr_srcptr, mp_rnd_t), char *foo) +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; int i, inexa, inexd; - mp_rnd_t r; + mpfr_rnd_t r; p1 = (randlimb () % 200) + MPFR_PREC_MIN; p2 = (randlimb () % 200) + MPFR_PREC_MIN; diff --git a/tests/tcan_round.c b/tests/tcan_round.c index 32bbfce95..4079e2613 100644 --- a/tests/tcan_round.c +++ b/tests/tcan_round.c @@ -98,7 +98,7 @@ main (void) int r1, r2; for (r1 = 0; r1 < MPFR_RND_MAX ; r1++) for (r2 = 0; r2 < MPFR_RND_MAX ; r2++) - mpfr_can_round (x, i, (mp_rnd_t) r1, (mp_rnd_t) r2, j); /* test for assertions */ + mpfr_can_round (x, i, (mpfr_rnd_t) r1, (mpfr_rnd_t) r2, j); /* test for assertions */ } mpfr_clear (x); diff --git a/tests/tcbrt.c b/tests/tcbrt.c index 46b9af6c8..b74f18ea0 100644 --- a/tests/tcbrt.c +++ b/tests/tcbrt.c @@ -167,21 +167,21 @@ main (void) for (r = 0; r < MPFR_RND_MAX; r++) { mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_cbrt (x, x, (mp_rnd_t) r); + mpfr_cbrt (x, x, (mpfr_rnd_t) r); if (mpfr_cmp_ui (x, 1)) { printf ("Error in mpfr_cbrt for x=1, rnd=%s\ngot ", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN); printf ("\n"); exit (1); } mpfr_set_si (x, -1, MPFR_RNDN); - mpfr_cbrt (x, x, (mp_rnd_t) r); + mpfr_cbrt (x, x, (mpfr_rnd_t) r); if (mpfr_cmp_si (x, -1)) { printf ("Error in mpfr_cbrt for x=-1, rnd=%s\ngot ", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN); printf ("\n"); exit (1); @@ -199,7 +199,7 @@ main (void) { printf ("Error in mpfr_cbrt for " "x = 27.0 * 2^(%d), rnd=%s\ngot ", - 3*i, mpfr_print_rnd_mode ((mp_rnd_t) r)); + 3*i, mpfr_print_rnd_mode ((mpfr_rnd_t) r)); mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN); printf ("\ninstead of 3 * 2^(%d)\n", i); exit (1); diff --git a/tests/tcmp.c b/tests/tcmp.c index 53397fc1b..a1e97cb3a 100644 --- a/tests/tcmp.c +++ b/tests/tcmp.c @@ -80,16 +80,16 @@ main (void) mpfr_set_prec (xx, 53); mpfr_set_prec (yy, 200); - mpfr_set_ui (xx, 1, (mp_rnd_t) 0); - mpfr_set_ui (yy, 1, (mp_rnd_t) 0); + mpfr_set_ui (xx, 1, (mpfr_rnd_t) 0); + mpfr_set_ui (yy, 1, (mpfr_rnd_t) 0); if (mpfr_cmp (xx, yy) != 0) { printf ("Error in mpfr_cmp: 1.0 != 1.0\n"); exit (1); } mpfr_set_prec (yy, 31); - mpfr_set_str (xx, "1.0000000002", 10, (mp_rnd_t) 0); - mpfr_set_ui (yy, 1, (mp_rnd_t) 0); + mpfr_set_str (xx, "1.0000000002", 10, (mpfr_rnd_t) 0); + mpfr_set_ui (yy, 1, (mpfr_rnd_t) 0); if (!(mpfr_cmp (xx,yy)>0)) { printf ("Error in mpfr_cmp: not 1.0000000002 > 1.0\n"); diff --git a/tests/tcmpabs.c b/tests/tcmpabs.c index 6485c80e3..030b8c6d2 100644 --- a/tests/tcmpabs.c +++ b/tests/tcmpabs.c @@ -72,14 +72,14 @@ main (void) mpfr_set_prec(xx, 53); mpfr_set_prec(yy, 200); - mpfr_set_ui (xx, 1, (mp_rnd_t) 0); - mpfr_set_ui (yy, 1, (mp_rnd_t) 0); + mpfr_set_ui (xx, 1, (mpfr_rnd_t) 0); + mpfr_set_ui (yy, 1, (mpfr_rnd_t) 0); if (mpfr_cmpabs(xx, yy) != 0) ERROR ("Error in mpfr_cmpabs: 1.0 != 1.0\n"); mpfr_set_prec (yy, 31); - mpfr_set_str (xx, "-1.0000000002", 10, (mp_rnd_t) 0); - mpfr_set_ui (yy, 1, (mp_rnd_t) 0); + mpfr_set_str (xx, "-1.0000000002", 10, (mpfr_rnd_t) 0); + mpfr_set_ui (yy, 1, (mpfr_rnd_t) 0); if (!(mpfr_cmpabs(xx,yy)>0)) ERROR ("Error in mpfr_cmpabs: not 1.0000000002 > 1.0\n"); mpfr_set_prec(yy, 53); diff --git a/tests/tconst_catalan.c b/tests/tconst_catalan.c index 232aa7e79..0370ec86e 100644 --- a/tests/tconst_catalan.c +++ b/tests/tconst_catalan.c @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* Wrapper for tgeneric */ static int -my_const_catalan (mpfr_ptr x, mpfr_srcptr y, mp_rnd_t r) +my_const_catalan (mpfr_ptr x, mpfr_srcptr y, mpfr_rnd_t r) { return mpfr_const_catalan (x, r); } diff --git a/tests/tconst_euler.c b/tests/tconst_euler.c index 18d797fbe..4e4becfdc 100644 --- a/tests/tconst_euler.c +++ b/tests/tconst_euler.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* Wrapper for tgeneric */ static int -my_const_euler (mpfr_ptr x, mpfr_srcptr y, mp_rnd_t r) +my_const_euler (mpfr_ptr x, mpfr_srcptr y, mpfr_rnd_t r) { return mpfr_const_euler (x, r); } @@ -80,16 +80,16 @@ main (int argc, char *argv[]) for (rnd = 0; rnd < MPFR_RND_MAX; rnd++) { mpfr_set_prec (y, yprec); - mpfr_const_euler (y, (mp_rnd_t) rnd); + mpfr_const_euler (y, (mpfr_rnd_t) rnd); err = (rnd == MPFR_RNDN) ? yprec + 1 : yprec; - if (mpfr_can_round (y, err, (mp_rnd_t) rnd, (mp_rnd_t) rnd, prec)) + if (mpfr_can_round (y, err, (mpfr_rnd_t) rnd, (mpfr_rnd_t) rnd, prec)) { - mpfr_set (t, y, (mp_rnd_t) rnd); - mpfr_const_euler (z, (mp_rnd_t) rnd); + mpfr_set (t, y, (mpfr_rnd_t) rnd); + mpfr_const_euler (z, (mpfr_rnd_t) rnd); if (mpfr_cmp (t, z)) { printf ("results differ for prec=%u rnd_mode=%s\n", prec, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, MPFR_RNDN); puts (""); diff --git a/tests/tconst_log2.c b/tests/tconst_log2.c index fcf4e06bd..5b11160b8 100644 --- a/tests/tconst_log2.c +++ b/tests/tconst_log2.c @@ -31,7 +31,7 @@ static void check (mp_prec_t p0, mp_prec_t p1) { mpfr_t x, y, z; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int dif; mpfr_init (x); @@ -127,7 +127,7 @@ check_cache (void) /* Wrapper for tgeneric */ static int -my_const_log2 (mpfr_ptr x, mpfr_srcptr y, mp_rnd_t r) +my_const_log2 (mpfr_ptr x, mpfr_srcptr y, mpfr_rnd_t r) { return mpfr_const_log2 (x, r); } @@ -141,12 +141,12 @@ main (int argc, char *argv[]) { mpfr_t x; int p; - mp_rnd_t rnd; + mpfr_rnd_t rnd; tests_start_mpfr (); p = (argc>1) ? atoi(argv[1]) : 53; - rnd = (argc>2) ? (mp_rnd_t) atoi(argv[2]) : MPFR_RNDZ; + rnd = (argc>2) ? (mpfr_rnd_t) atoi(argv[2]) : MPFR_RNDZ; mpfr_init (x); diff --git a/tests/tconst_pi.c b/tests/tconst_pi.c index b3eebfbc4..c49c482c2 100644 --- a/tests/tconst_pi.c +++ b/tests/tconst_pi.c @@ -62,7 +62,7 @@ check_large (void) /* Wrapper for tgeneric */ static int -my_const_pi (mpfr_ptr x, mpfr_srcptr y, mp_rnd_t r) +my_const_pi (mpfr_ptr x, mpfr_srcptr y, mpfr_rnd_t r) { return mpfr_const_pi (x, r); } @@ -76,7 +76,7 @@ main (int argc, char *argv[]) { mpfr_t x; mp_prec_t p; - mp_rnd_t rnd; + mpfr_rnd_t rnd; tests_start_mpfr (); @@ -88,7 +88,7 @@ main (int argc, char *argv[]) p = a; } - rnd = (argc > 2) ? (mp_rnd_t) atoi(argv[2]) : MPFR_RNDZ; + rnd = (argc > 2) ? (mpfr_rnd_t) atoi(argv[2]) : MPFR_RNDZ; mpfr_init2 (x, p); mpfr_const_pi (x, rnd); diff --git a/tests/tcopysign.c b/tests/tcopysign.c index 91bbe918b..15acd5410 100644 --- a/tests/tcopysign.c +++ b/tests/tcopysign.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static void copysign_variant (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, - mp_rnd_t rnd_mode, int k) + mpfr_rnd_t rnd_mode, int k) { mpfr_clear_flags (); switch (k) diff --git a/tests/tcos.c b/tests/tcos.c index eedc40b26..07e74a2f1 100644 --- a/tests/tcos.c +++ b/tests/tcos.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_cos (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +test_cos (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_get_prec (a)>=53; @@ -49,7 +49,7 @@ test_cos (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) #endif static void -check53 (const char *xs, const char *cos_xs, mp_rnd_t rnd_mode) +check53 (const char *xs, const char *cos_xs, mpfr_rnd_t rnd_mode) { mpfr_t xx, c; @@ -184,13 +184,13 @@ overflowed_cos0 (void) { mpfr_set_si_2exp (x, i, -512 * ABS (i), MPFR_RNDN); mpfr_clear_flags (); - inex = mpfr_cos (x, x, (mp_rnd_t) rnd); + inex = mpfr_cos (x, x, (mpfr_rnd_t) rnd); if ((i == 0 || emax < 0 || rnd == MPFR_RNDN || rnd == MPFR_RNDU) && ! mpfr_overflow_p ()) { printf ("Error in overflowed_cos0 (i = %d, rnd = %s):\n" " The overflow flag is not set.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (rnd == MPFR_RNDZ || rnd == MPFR_RNDD) @@ -199,13 +199,13 @@ overflowed_cos0 (void) { printf ("Error in overflowed_cos0 (i = %d, rnd = %s):\n" " The inexact value must be negative.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (x, y)) { printf ("Error in overflowed_cos0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of 0.11111111E%d.\n", emax); err = 1; @@ -217,13 +217,13 @@ overflowed_cos0 (void) { printf ("Error in overflowed_cos0 (i = %d, rnd = %s):\n" " The inexact value must be positive.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! (mpfr_inf_p (x) && MPFR_SIGN (x) > 0)) { printf ("Error in overflowed_cos0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of +Inf.\n"); err = 1; diff --git a/tests/tcot.c b/tests/tcot.c index bb33c6acb..c5094edb6 100644 --- a/tests/tcot.c +++ b/tests/tcot.c @@ -102,18 +102,18 @@ two2emin (mp_exp_t e) RND_LOOP (rnd) { mpfr_set_si (y, i, MPFR_RNDN); - mpfr_ui_div (y, 1, y, (mp_rnd_t) rnd); /* no overflow/underflow */ + mpfr_ui_div (y, 1, y, (mpfr_rnd_t) rnd); /* no overflow/underflow */ mpfr_set_si_2exp (x, i, -e, MPFR_RNDN); if (ABS (i) != 3) /* not a power of 2 (not 0 either) */ - mpfr_sub (y, y, x, (mp_rnd_t) rnd); /* no overflow/underflow */ + mpfr_sub (y, y, x, (mpfr_rnd_t) rnd); /* no overflow/underflow */ mpfr_set_ui_2exp (x, 1, -e, MPFR_RNDN); - mpfr_div (y, y, x, (mp_rnd_t) rnd); /* 1/x - SIGN(x).epsilon */ + mpfr_div (y, y, x, (mpfr_rnd_t) rnd); /* 1/x - SIGN(x).epsilon */ mpfr_set_si_2exp (x, i, -e, MPFR_RNDN); - mpfr_cot (x, x, (mp_rnd_t) rnd); + mpfr_cot (x, x, (mpfr_rnd_t) rnd); if (! mpfr_equal_p (x, y)) { printf ("Error in two2emin for i = %d and rnd = %s\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf ("Got "); mpfr_dump (x); printf ("instead of "); diff --git a/tests/tcoth.c b/tests/tcoth.c index 5ab4ee204..e3508437b 100644 --- a/tests/tcoth.c +++ b/tests/tcoth.c @@ -149,13 +149,13 @@ underflowed_cothinf (void) mpfr_set_inf (x, i); mpfr_clear_flags (); set_emin (2); /* 1 is not representable. */ - inex = mpfr_coth (x, x, (mp_rnd_t) rnd); + inex = mpfr_coth (x, x, (mpfr_rnd_t) rnd); set_emin (old_emin); if (! mpfr_underflow_p ()) { printf ("Error in underflowed_cothinf (i = %d, rnd = %s):\n" " The underflow flag is not set.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } mpfr_set_si (y, (i < 0 && (rnd == MPFR_RNDD || rnd == MPFR_RNDA)) || @@ -167,7 +167,7 @@ underflowed_cothinf (void) MPFR_MULT_SIGN (MPFR_SIGN (x), MPFR_SIGN (y)) > 0)) { printf ("Error in underflowed_cothinf (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of "); mpfr_print_binary (y); @@ -179,7 +179,7 @@ underflowed_cothinf (void) { printf ("Error in underflowed_cothinf (i = %d, rnd = %s):\n" " The inexact value must be negative.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if ((rnd == MPFR_RNDU || @@ -187,7 +187,7 @@ underflowed_cothinf (void) { printf ("Error in underflowed_cothinf (i = %d, rnd = %s):\n" " The inexact value must be positive.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } } diff --git a/tests/tdiv.c b/tests/tdiv.c index 9bfd1e440..dab8ba678 100644 --- a/tests/tdiv.c +++ b/tests/tdiv.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_div (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +test_div (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_number_p (c); @@ -65,7 +65,7 @@ inex_cmp (int a, int b) } static void -check4 (const char *Ns, const char *Ds, mp_rnd_t rnd_mode, int p, +check4 (const char *Ns, const char *Ds, mpfr_rnd_t rnd_mode, int p, const char *Qs) { mpfr_t q, n, d; @@ -88,7 +88,7 @@ check4 (const char *Ns, const char *Ds, mp_rnd_t rnd_mode, int p, } static void -check24 (const char *Ns, const char *Ds, mp_rnd_t rnd_mode, const char *Qs) +check24 (const char *Ns, const char *Ds, mpfr_rnd_t rnd_mode, const char *Qs) { mpfr_t q, n, d; @@ -253,11 +253,11 @@ check_convergence (void) RND_LOOP(j) { mpfr_set_ui (y, 1, MPFR_RNDN); - test_div (y, x, y, (mp_rnd_t) j); + test_div (y, x, y, (mpfr_rnd_t) j); if (mpfr_cmp_ui (y, 1)) { printf ("mpfr_div failed for x=1.0, y=1.0, prec=%d rnd=%s\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) j)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) j)); printf ("got "); mpfr_print_binary(y); puts (""); exit (1); } @@ -330,12 +330,12 @@ check_hard (void) { RND_LOOP(rnd) { - inex = test_div (q, u, v, (mp_rnd_t) rnd); + inex = test_div (q, u, v, (mpfr_rnd_t) rnd); inex2 = get_inexact (q, u, v); if (inex_cmp (inex, inex2)) { printf ("Wrong inexact flag for rnd=%s: expected %d, got %d\n", - mpfr_print_rnd_mode ((mp_rnd_t) rnd), inex2, inex); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd), inex2, inex); printf ("u= "); mpfr_dump (u); printf ("v= "); mpfr_dump (v); printf ("q= "); mpfr_dump (q); @@ -517,7 +517,7 @@ check_inexact (void) mpfr_t x, y, z, u; mp_prec_t px, py, pu; int inexact, cmp; - mp_rnd_t rnd; + mpfr_rnd_t rnd; mpfr_init (x); mpfr_init (y); @@ -767,7 +767,7 @@ consistency (void) for (i = 0; i < 10000; i++) { - mp_rnd_t rnd; + mpfr_rnd_t rnd; mp_prec_t px, py, pz, p; int inex1, inex2; diff --git a/tests/tdiv_ui.c b/tests/tdiv_ui.c index d86324901..ba821b989 100644 --- a/tests/tdiv_ui.c +++ b/tests/tdiv_ui.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-test.h" static void -check (const char *ds, unsigned long u, mp_rnd_t rnd, const char *es) +check (const char *ds, unsigned long u, mpfr_rnd_t rnd, const char *es) { mpfr_t x, y; @@ -168,8 +168,8 @@ check_inexact (void) mpfr_set_prec (z, py + mp_bits_per_limb); for (rnd = 0; rnd < MPFR_RND_MAX; rnd++) { - inexact = mpfr_div_ui (y, x, u, (mp_rnd_t) rnd); - if (mpfr_mul_ui (z, y, u, (mp_rnd_t) rnd)) + inexact = mpfr_div_ui (y, x, u, (mpfr_rnd_t) rnd); + if (mpfr_mul_ui (z, y, u, (mpfr_rnd_t) rnd)) { printf ("z <- y * u should be exact for u=%lu\n", u); printf ("y="); mpfr_print_binary (y); puts (""); @@ -182,7 +182,7 @@ check_inexact (void) ((inexact < 0) && (cmp >= 0))) { printf ("Wrong inexact flag for u=%lu, rnd=%s\n", u, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf ("x="); mpfr_print_binary (x); puts (""); printf ("y="); mpfr_print_binary (y); puts (""); exit (1); diff --git a/tests/teq.c b/tests/teq.c index 06aa84d4e..642b9813d 100644 --- a/tests/teq.c +++ b/tests/teq.c @@ -76,8 +76,8 @@ special (void) mpfr_init2 (y, 53); mpfr_init2 (z, 53); - mpfr_set_str (x, "1", 10, (mp_rnd_t) 0); - mpfr_set_str (y, "1e-10000", 10, (mp_rnd_t) 0); + mpfr_set_str (x, "1", 10, (mpfr_rnd_t) 0); + mpfr_set_str (y, "1e-10000", 10, (mpfr_rnd_t) 0); mpfr_add (z, x, y, MPFR_RNDU); for (i = 1; i <= 52; i++) diff --git a/tests/tests.c b/tests/tests.c index 0f3875754..680cba116 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -534,10 +534,10 @@ tests_default_random (mpfr_ptr x, int pos, mp_exp_t emin, mp_exp_t emax) bad_cases functions. */ static void test5rm (int (*fct) (FLIST), mpfr_srcptr x, mpfr_ptr y, mpfr_ptr z, - mp_rnd_t rnd, int test_one, char *name) + mpfr_rnd_t rnd, int test_one, char *name) { mp_prec_t yprec = MPFR_PREC (y); - mp_rnd_t rndnext = MPFR_RND_MAX; /* means uninitialized */ + mpfr_rnd_t rndnext = MPFR_RND_MAX; /* means uninitialized */ MPFR_ASSERTN (test_one || rnd == MPFR_RNDZ); mpfr_set_prec (z, yprec); @@ -622,7 +622,7 @@ data_check (char *f, int (*foo) (FLIST), char *name) FILE *fp; mp_prec_t xprec, yprec; mpfr_t x, y, z; - mp_rnd_t rnd; + mpfr_rnd_t rnd; char r; int c; diff --git a/tests/texceptions.c b/tests/texceptions.c index 561bd78e7..219b1f631 100644 --- a/tests/texceptions.c +++ b/tests/texceptions.c @@ -46,21 +46,21 @@ static void check_default_rnd (void) { int r; - mp_rnd_t t; + mpfr_rnd_t t; for(r = 0 ; r < MPFR_RND_MAX ; r++) { - mpfr_set_default_rounding_mode ((mp_rnd_t) r); + mpfr_set_default_rounding_mode ((mpfr_rnd_t) r); t = (mpfr_get_default_rounding_mode) (); - if ((mp_rnd_t) r != t) + if ((mpfr_rnd_t) r != t) { printf ("%s %s\n", mpfr_print_rnd_mode (r), mpfr_print_rnd_mode (t)); ERROR("ERROR in setting / getting default rounding mode (1)"); } } - mpfr_set_default_rounding_mode ((mp_rnd_t) MPFR_RND_MAX); + mpfr_set_default_rounding_mode ((mpfr_rnd_t) MPFR_RND_MAX); if (mpfr_get_default_rounding_mode() != MPFR_RNDA) ERROR("ERROR in setting / getting default rounding mode (2)"); - mpfr_set_default_rounding_mode((mp_rnd_t) -1); + mpfr_set_default_rounding_mode((mpfr_rnd_t) -1); if (mpfr_get_default_rounding_mode() != MPFR_RNDA) ERROR("ERROR in setting / getting default rounding mode (3)"); } @@ -211,11 +211,11 @@ test_set_underflow (void) int inex; j = s < 0 && i > 1 ? 5 - i : i; - inex = mpfr_underflow (x, (mp_rnd_t) i, s); + inex = mpfr_underflow (x, (mpfr_rnd_t) i, s); if (mpfr_cmp (x, r[j]) || inex * t[j] <= 0) { printf ("Error in test_set_underflow, sign = %d," - " rnd_mode = %s\n", s, mpfr_print_rnd_mode ((mp_rnd_t) i)); + " rnd_mode = %s\n", s, mpfr_print_rnd_mode ((mpfr_rnd_t) i)); printf ("Got\n"); mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN); printf (", inex = %d\ninstead of\n", inex); @@ -253,11 +253,11 @@ test_set_overflow (void) int inex; j = s < 0 && i > 1 ? 5 - i : i; - inex = mpfr_overflow (x, (mp_rnd_t) i, s); + inex = mpfr_overflow (x, (mpfr_rnd_t) i, s); if (mpfr_cmp (x, r[j]) || inex * t[j] <= 0) { printf ("Error in test_set_overflow, sign = %d," - " rnd_mode = %s\n", s, mpfr_print_rnd_mode ((mp_rnd_t) i)); + " rnd_mode = %s\n", s, mpfr_print_rnd_mode ((mpfr_rnd_t) i)); printf ("Got\n"); mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN); printf (", inex = %d\ninstead of\n", inex); diff --git a/tests/texp.c b/tests/texp.c index d1d3bb518..1e4ac96c9 100644 --- a/tests/texp.c +++ b/tests/texp.c @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_exp (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +test_exp (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_get_prec (a)>=53; @@ -51,7 +51,7 @@ test_exp (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) /* returns the number of ulp of error */ static void -check3 (const char *op, mp_rnd_t rnd, const char *res) +check3 (const char *op, mpfr_rnd_t rnd, const char *res) { mpfr_t x, y; @@ -160,7 +160,7 @@ compare_exp2_exp3 (mp_prec_t p0, mp_prec_t p1) { mpfr_t x, y, z; mp_prec_t prec; - mp_rnd_t rnd; + mpfr_rnd_t rnd; mpfr_init (x); mpfr_init (y); @@ -535,13 +535,13 @@ overflowed_exp0 (void) { mpfr_set_si_2exp (x, i, -512 * ABS (i), MPFR_RNDN); mpfr_clear_flags (); - inex = mpfr_exp (x, x, (mp_rnd_t) rnd); + inex = mpfr_exp (x, x, (mpfr_rnd_t) rnd); if ((i >= 0 || emax < 0 || rnd == MPFR_RNDN || rnd == MPFR_RNDU) && ! mpfr_overflow_p ()) { printf ("Error in overflowed_exp0 (i = %d, rnd = %s):\n" " The overflow flag is not set.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (rnd == MPFR_RNDZ || rnd == MPFR_RNDD) @@ -550,13 +550,13 @@ overflowed_exp0 (void) { printf ("Error in overflowed_exp0 (i = %d, rnd = %s):\n" " The inexact value must be negative.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (x, y)) { printf ("Error in overflowed_exp0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of 0.11111111E%d.\n", emax); err = 1; @@ -568,13 +568,13 @@ overflowed_exp0 (void) { printf ("Error in overflowed_exp0 (i = %d, rnd = %s):\n" " The inexact value must be positive.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! (mpfr_inf_p (x) && MPFR_SIGN (x) > 0)) { printf ("Error in overflowed_exp0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of +Inf.\n"); err = 1; @@ -629,7 +629,7 @@ bug20080731 (void) /* Emulate mpfr_exp with mpfr_exp_3 in the general case. */ static int -exp_3 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +exp_3 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { int inexact; @@ -709,7 +709,7 @@ underflow_up (int extended_emin) if (__gmpfr_flags != MPFR_FLAGS_INEXACT) { printf ("Incorrect flags in underflow_up, eps > 0, %s", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); if (extended_emin) printf (" and extended emin"); printf ("\nfor precx = %d, precy = %d, %s\n", @@ -721,7 +721,7 @@ underflow_up (int extended_emin) if (mpfr_cmp0 (y, minpos) < 0) { printf ("Incorrect result in underflow_up, eps > 0, %s", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); if (extended_emin) printf (" and extended emin"); printf ("\nfor precx = %d, precy = %d, %s\n", @@ -826,7 +826,7 @@ underflow_up (int extended_emin) if (__gmpfr_flags != flags) { printf ("Incorrect flags in underflow_up, %s", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); if (extended_emin) printf (" and extended emin"); printf ("\nfor precx = %d, precy = %d, ", @@ -845,7 +845,7 @@ underflow_up (int extended_emin) mpfr_cmp0 (y, minpos) != 0 : MPFR_NOTZERO (y)) { printf ("Incorrect result in underflow_up, %s", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); if (extended_emin) printf (" and extended emin"); printf ("\nfor precx = %d, precy = %d, ", diff --git a/tests/texp10.c b/tests/texp10.c index 27d6b6fa9..71a5e8190 100644 --- a/tests/texp10.c +++ b/tests/texp10.c @@ -137,13 +137,13 @@ overfl_exp10_0 (void) { mpfr_set_si_2exp (x, i, -512 * ABS (i), MPFR_RNDN); mpfr_clear_flags (); - inex = mpfr_exp10 (x, x, (mp_rnd_t) rnd); + inex = mpfr_exp10 (x, x, (mpfr_rnd_t) rnd); if ((i >= 0 || emax < 0 || rnd == MPFR_RNDN || rnd == MPFR_RNDU) && ! mpfr_overflow_p ()) { printf ("Error in overfl_exp10_0 (i = %d, rnd = %s):\n" " The overflow flag is not set.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (rnd == MPFR_RNDZ || rnd == MPFR_RNDD) @@ -152,13 +152,13 @@ overfl_exp10_0 (void) { printf ("Error in overfl_exp10_0 (i = %d, rnd = %s):\n" " The inexact value must be negative.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (x, y)) { printf ("Error in overfl_exp10_0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of 0.11111111E%d.\n", emax); err = 1; @@ -170,13 +170,13 @@ overfl_exp10_0 (void) { printf ("Error in overfl_exp10_0 (i = %d, rnd = %s):\n" " The inexact value must be positive.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! (mpfr_inf_p (x) && MPFR_SIGN (x) > 0)) { printf ("Error in overfl_exp10_0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of +Inf.\n"); err = 1; diff --git a/tests/texp2.c b/tests/texp2.c index ca4078860..88b2c42a9 100644 --- a/tests/texp2.c +++ b/tests/texp2.c @@ -162,13 +162,13 @@ overflowed_exp2_0 (void) { mpfr_set_si_2exp (x, i, -512 * ABS (i), MPFR_RNDN); mpfr_clear_flags (); - inex = mpfr_exp2 (x, x, (mp_rnd_t) rnd); + inex = mpfr_exp2 (x, x, (mpfr_rnd_t) rnd); if ((i >= 0 || emax < 0 || rnd == MPFR_RNDN || rnd == MPFR_RNDU) && ! mpfr_overflow_p ()) { printf ("Error in overflowed_exp2_0 (i = %d, rnd = %s):\n" " The overflow flag is not set.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (rnd == MPFR_RNDZ || rnd == MPFR_RNDD) @@ -177,13 +177,13 @@ overflowed_exp2_0 (void) { printf ("Error in overflowed_exp2_0 (i = %d, rnd = %s):\n" " The inexact value must be negative.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (x, y)) { printf ("Error in overflowed_exp2_0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of 0.11111111E%d.\n", emax); err = 1; @@ -195,13 +195,13 @@ overflowed_exp2_0 (void) { printf ("Error in overflowed_exp2_0 (i = %d, rnd = %s):\n" " The inexact value must be positive.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! (mpfr_inf_p (x) && MPFR_SIGN (x) > 0)) { printf ("Error in overflowed_exp2_0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of +Inf.\n"); err = 1; diff --git a/tests/texpm1.c b/tests/texpm1.c index 21b81bfc5..7e1f0a45e 100644 --- a/tests/texpm1.c +++ b/tests/texpm1.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_expm1 (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +test_expm1 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_get_prec (a)>=53; diff --git a/tests/tfactorial.c b/tests/tfactorial.c index a3633d01e..2ac4e7ca8 100644 --- a/tests/tfactorial.c +++ b/tests/tfactorial.c @@ -93,19 +93,19 @@ test_int (void) mpfr_set_prec (y, p); for (r = 0; r < MPFR_RND_MAX; r++) { - inex1 = mpfr_fac_ui (x, n, (mp_rnd_t) r); - inex2 = mpfr_set_z (y, f, (mp_rnd_t) r); + inex1 = mpfr_fac_ui (x, n, (mpfr_rnd_t) r); + inex2 = mpfr_set_z (y, f, (mpfr_rnd_t) r); if (mpfr_cmp (x, y)) { printf ("Error for n=%lu prec=%lu rnd=%s\n", - n, (unsigned long) p, mpfr_print_rnd_mode ((mp_rnd_t) r)); + n, (unsigned long) p, mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } if ((inex1 < 0 && inex2 >= 0) || (inex1 == 0 && inex2 != 0) || (inex1 > 0 && inex2 <= 0)) { printf ("Wrong inexact flag for n=%lu prec=%lu rnd=%s\n", - n, (unsigned long) p, mpfr_print_rnd_mode ((mp_rnd_t) r)); + n, (unsigned long) p, mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } } @@ -135,12 +135,12 @@ overflowed_fac0 (void) RND_LOOP (rnd) { mpfr_clear_flags (); - inex = mpfr_fac_ui (x, 0, (mp_rnd_t) rnd); + inex = mpfr_fac_ui (x, 0, (mpfr_rnd_t) rnd); if (! mpfr_overflow_p ()) { printf ("Error in overflowed_fac0 (rnd = %s):\n" " The overflow flag is not set.\n", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (rnd == MPFR_RNDZ || rnd == MPFR_RNDD) @@ -149,13 +149,13 @@ overflowed_fac0 (void) { printf ("Error in overflowed_fac0 (rnd = %s):\n" " The inexact value must be negative.\n", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (x, y)) { printf ("Error in overflowed_fac0 (rnd = %s):\n" - " Got ", mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of 0.11111111E0.\n"); err = 1; @@ -167,13 +167,13 @@ overflowed_fac0 (void) { printf ("Error in overflowed_fac0 (rnd = %s):\n" " The inexact value must be positive.\n", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! (mpfr_inf_p (x) && MPFR_SIGN (x) > 0)) { printf ("Error in overflowed_fac0 (rnd = %s):\n" - " Got ", mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of +Inf.\n"); err = 1; @@ -226,12 +226,12 @@ main (int argc, char *argv[]) for (n = 0; n < 50; n++) for (rnd = 0; rnd < MPFR_RND_MAX; rnd++) { - inexact = mpfr_fac_ui (y, n, (mp_rnd_t) rnd); + inexact = mpfr_fac_ui (y, n, (mpfr_rnd_t) rnd); err = (rnd == MPFR_RNDN) ? yprec + 1 : yprec; - if (mpfr_can_round (y, err, (mp_rnd_t) rnd, (mp_rnd_t) rnd, prec)) + if (mpfr_can_round (y, err, (mpfr_rnd_t) rnd, (mpfr_rnd_t) rnd, prec)) { - mpfr_set (t, y, (mp_rnd_t) rnd); - inexact = mpfr_fac_ui (z, n, (mp_rnd_t) rnd); + mpfr_set (t, y, (mpfr_rnd_t) rnd); + inexact = mpfr_fac_ui (z, n, (mpfr_rnd_t) rnd); /* fact(n) ends with floor(n/2)+floor(n/4)+... zeros */ for (k=n/2, zeros=0; k; k >>= 1) zeros += k; @@ -259,7 +259,7 @@ main (int argc, char *argv[]) printf ("results differ for x="); mpfr_out_str (stdout, 2, prec, x, MPFR_RNDN); printf (" prec=%u rnd_mode=%s\n", prec, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, MPFR_RNDN); puts (""); diff --git a/tests/tfma.c b/tests/tfma.c index 3bb3e19b5..575cca732 100644 --- a/tests/tfma.c +++ b/tests/tfma.c @@ -46,14 +46,14 @@ test_exact (void) if (mpfr_set_str (a, val[i], 10, MPFR_RNDN) || mpfr_set_str (b, val[j], 10, MPFR_RNDN) || mpfr_set_str (c, val[k], 10, MPFR_RNDN) || - mpfr_mul (r1, a, b, (mp_rnd_t) rnd) || - mpfr_add (r1, r1, c, (mp_rnd_t) rnd)) + mpfr_mul (r1, a, b, (mpfr_rnd_t) rnd) || + mpfr_add (r1, r1, c, (mpfr_rnd_t) rnd)) { printf ("test_exact internal error for (%d,%d,%d,%d)\n", i, j, k, rnd); exit (1); } - if (mpfr_fma (r2, a, b, c, (mp_rnd_t) rnd)) + if (mpfr_fma (r2, a, b, c, (mpfr_rnd_t) rnd)) { printf ("test_exact(%d,%d,%d,%d): mpfr_fma should be exact\n", i, j, k, rnd); @@ -139,37 +139,37 @@ test_overflow2 (void) mpfr_clear_flags (); /* One has: x * y = -1@emax exactly (but not representable). */ - inex = mpfr_fma (r, x, y, z, (mp_rnd_t) rnd); + inex = mpfr_fma (r, x, y, z, (mpfr_rnd_t) rnd); if (overflow ^ (mpfr_overflow_p () != 0)) { printf ("Error in test_overflow2 (i = %d, %s): wrong overflow" " flag (should be %d)\n", i, - mpfr_print_rnd_mode ((mp_rnd_t) rnd), overflow); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd), overflow); err = 1; } if (mpfr_nanflag_p ()) { printf ("Error in test_overflow2 (i = %d, %s): NaN flag should" - " not be set\n", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " not be set\n", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (mpfr_nan_p (r)) { printf ("Error in test_overflow2 (i = %d, %s): got NaN\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } else if (MPFR_SIGN (r) >= 0) { printf ("Error in test_overflow2 (i = %d, %s): wrong sign " "(+ instead of -)\n", i, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } else if (inf && ! mpfr_inf_p (r)) { printf ("Error in test_overflow2 (i = %d, %s): expected -Inf," - " got\n", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " got\n", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_dump (r); err = 1; } @@ -177,7 +177,7 @@ test_overflow2 (void) (mpfr_nextbelow (r), ! mpfr_inf_p (r)))) { printf ("Error in test_overflow2 (i = %d, %s): expected -MAX," - " got\n", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " got\n", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_dump (r); err = 1; } @@ -185,7 +185,7 @@ test_overflow2 (void) { printf ("Error in test_overflow2 (i = %d, %s): wrong inexact" " flag (got %d)\n", i, - mpfr_print_rnd_mode ((mp_rnd_t) rnd), inex); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd), inex); err = 1; } @@ -219,12 +219,12 @@ test_underflow1 (void) mpfr_setmax (z, mpfr_get_emax ()); /* |z| = 1 or 2^emax - ulp */ mpfr_clear_flags (); - inex = mpfr_fma (r, x, y, z, (mp_rnd_t) rnd); + inex = mpfr_fma (r, x, y, z, (mpfr_rnd_t) rnd); #define ERRTU1 "Error in test_underflow1 (signy = %d, signz = %d, %s)\n " if (mpfr_nanflag_p ()) { printf (ERRTU1 "NaN flag is set\n", signy, signz, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (signy < 0 && MPFR_IS_LIKE_RNDD(rnd, signz)) @@ -234,19 +234,19 @@ test_underflow1 (void) if ((mpfr_overflow_p () != 0) ^ (mpfr_inf_p (z) != 0)) { printf (ERRTU1 "wrong overflow flag\n", signy, signz, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (mpfr_underflow_p ()) { printf (ERRTU1 "underflow flag is set\n", signy, signz, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (r, z)) { printf (ERRTU1 "got ", signy, signz, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (r); printf (" instead of "); mpfr_print_binary (z); @@ -258,7 +258,7 @@ test_underflow1 (void) (rnd == MPFR_RNDN && signy > 0))) { printf (ERRTU1 "ternary value = %d instead of < 0\n", - signy, signz, mpfr_print_rnd_mode ((mp_rnd_t) rnd), + signy, signz, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd), inex); err = 1; } @@ -267,7 +267,7 @@ test_underflow1 (void) (rnd == MPFR_RNDN && signy < 0))) { printf (ERRTU1 "ternary value = %d instead of > 0\n", - signy, signz, mpfr_print_rnd_mode ((mp_rnd_t) rnd), + signy, signz, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd), inex); err = 1; } @@ -541,7 +541,7 @@ main (int argc, char *argv[]) { mp_prec_t prec; mpfr_t t, slong; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact, compare; unsigned int n; diff --git a/tests/tfmod.c b/tests/tfmod.c index 65b590f48..2731ba34d 100644 --- a/tests/tfmod.c +++ b/tests/tfmod.c @@ -35,7 +35,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., r = x - n * y, where n = trunc(x/y). warning: may change flags. */ static int -slow_fmod (mpfr_ptr r, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd) +slow_fmod (mpfr_ptr r, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd) { mpfr_t q; int inexact; @@ -68,7 +68,7 @@ slow_fmod (mpfr_ptr r, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd) static void test_failed (mpfr_t erem, mpfr_t grem, int eret, int gret, mpfr_t x, mpfr_t y, - mp_rnd_t rnd) + mpfr_rnd_t rnd) { printf ("error: mpfr_fmod (r, x, y, rnd)\n x = "); mpfr_out_str (stdout, 10, 0, x, MPFR_RNDD); @@ -88,7 +88,7 @@ test_failed (mpfr_t erem, mpfr_t grem, int eret, int gret, mpfr_t x, mpfr_t y, } static void -check (mpfr_t r0, mpfr_t x, mpfr_t y, mp_rnd_t rnd) +check (mpfr_t r0, mpfr_t x, mpfr_t y, mpfr_rnd_t rnd) { int inex0, inex1; mpfr_t r1; diff --git a/tests/tfms.c b/tests/tfms.c index 0cfb3688a..2c5fd7cba 100644 --- a/tests/tfms.c +++ b/tests/tfms.c @@ -46,14 +46,14 @@ test_exact (void) if (mpfr_set_str (a, val[i], 10, MPFR_RNDN) || mpfr_set_str (b, val[j], 10, MPFR_RNDN) || mpfr_set_str (c, val[k], 10, MPFR_RNDN) || - mpfr_mul (r1, a, b, (mp_rnd_t) rnd) || - mpfr_sub (r1, r1, c, (mp_rnd_t) rnd)) + mpfr_mul (r1, a, b, (mpfr_rnd_t) rnd) || + mpfr_sub (r1, r1, c, (mpfr_rnd_t) rnd)) { printf ("test_exact internal error for (%d,%d,%d,%d)\n", i, j, k, rnd); exit (1); } - if (mpfr_fms (r2, a, b, c, (mp_rnd_t) rnd)) + if (mpfr_fms (r2, a, b, c, (mpfr_rnd_t) rnd)) { printf ("test_exact(%d,%d,%d,%d): mpfr_fms should be exact\n", i, j, k, rnd); @@ -139,37 +139,37 @@ test_overflow2 (void) mpfr_clear_flags (); /* One has: x * y = -1@emax exactly (but not representable). */ - inex = mpfr_fms (r, x, y, z, (mp_rnd_t) rnd); + inex = mpfr_fms (r, x, y, z, (mpfr_rnd_t) rnd); if (overflow ^ (mpfr_overflow_p () != 0)) { printf ("Error in test_overflow2 (i = %d, %s): wrong overflow" " flag (should be %d)\n", i, - mpfr_print_rnd_mode ((mp_rnd_t) rnd), overflow); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd), overflow); err = 1; } if (mpfr_nanflag_p ()) { printf ("Error in test_overflow2 (i = %d, %s): NaN flag should" - " not be set\n", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " not be set\n", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (mpfr_nan_p (r)) { printf ("Error in test_overflow2 (i = %d, %s): got NaN\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } else if (MPFR_SIGN (r) >= 0) { printf ("Error in test_overflow2 (i = %d, %s): wrong sign " "(+ instead of -)\n", i, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } else if (inf && ! mpfr_inf_p (r)) { printf ("Error in test_overflow2 (i = %d, %s): expected -Inf," - " got\n", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " got\n", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_dump (r); err = 1; } @@ -177,7 +177,7 @@ test_overflow2 (void) (mpfr_nextbelow (r), ! mpfr_inf_p (r)))) { printf ("Error in test_overflow2 (i = %d, %s): expected -MAX," - " got\n", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " got\n", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_dump (r); err = 1; } @@ -185,7 +185,7 @@ test_overflow2 (void) { printf ("Error in test_overflow2 (i = %d, %s): wrong inexact" " flag (got %d)\n", i, - mpfr_print_rnd_mode ((mp_rnd_t) rnd), inex); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd), inex); err = 1; } @@ -219,12 +219,12 @@ test_underflow1 (void) mpfr_setmax (z, mpfr_get_emax ()); /* |z| = 1 or 2^emax - ulp */ mpfr_clear_flags (); - inex = mpfr_fms (r, x, y, z, (mp_rnd_t) rnd); + inex = mpfr_fms (r, x, y, z, (mpfr_rnd_t) rnd); #define ERRTU1 "Error in test_underflow1 (signy = %d, signz = %d, %s)\n " if (mpfr_nanflag_p ()) { printf (ERRTU1 "NaN flag is set\n", signy, signz, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } mpfr_neg (z, z, MPFR_RNDN); @@ -235,19 +235,19 @@ test_underflow1 (void) if ((mpfr_overflow_p () != 0) ^ (mpfr_inf_p (z) != 0)) { printf (ERRTU1 "wrong overflow flag\n", signy, signz, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (mpfr_underflow_p ()) { printf (ERRTU1 "underflow flag is set\n", signy, signz, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (r, z)) { printf (ERRTU1 "got ", signy, signz, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (r); printf (" instead of "); mpfr_print_binary (z); @@ -259,7 +259,7 @@ test_underflow1 (void) (rnd == MPFR_RNDN && signy > 0))) { printf (ERRTU1 "ternary value = %d instead of < 0\n", - signy, signz, mpfr_print_rnd_mode ((mp_rnd_t) rnd), + signy, signz, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd), inex); err = 1; } @@ -268,7 +268,7 @@ test_underflow1 (void) (rnd == MPFR_RNDN && signy < 0))) { printf (ERRTU1 "ternary value = %d instead of > 0\n", - signy, signz, mpfr_print_rnd_mode ((mp_rnd_t) rnd), + signy, signz, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd), inex); err = 1; } @@ -544,7 +544,7 @@ main (int argc, char *argv[]) { mp_prec_t prec; mpfr_t t, slong; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact, compare; unsigned int n; diff --git a/tests/tfprintf.c b/tests/tfprintf.c index f56db8545..bd8ce61c7 100644 --- a/tests/tfprintf.c +++ b/tests/tfprintf.c @@ -160,7 +160,7 @@ check_mixed (FILE *fout) mpz_t mpz; mpq_t mpq; mpf_t mpf; - mp_rnd_t rnd = MPFR_RNDN; + mpfr_rnd_t rnd = MPFR_RNDN; mp_size_t limb_size = 3; mp_limb_t limb[3]; @@ -273,7 +273,7 @@ check_random (FILE *fout, int nb_tests) { int i; mpfr_t x; - mp_rnd_t rnd; + mpfr_rnd_t rnd; char flag[] = { '-', diff --git a/tests/tfrac.c b/tests/tfrac.c index ae8501144..6c3020b72 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, mp_rnd_t rnd) +check0 (mpfr_ptr ip, mpfr_ptr fp, mp_prec_t prec, mpfr_rnd_t rnd) { mpfr_t sum, tmp, dst, fp2; int inex1, inex2; @@ -118,12 +118,12 @@ check1 (mpfr_ptr ip, mpfr_ptr fp) for (rnd = 0; rnd < MPFR_RND_MAX ; rnd++) { - check0 (ip, fp, PMAX, (mp_rnd_t) rnd); - check0 (ip, fp, 70, (mp_rnd_t) rnd); + check0 (ip, fp, PMAX, (mpfr_rnd_t) rnd); + check0 (ip, fp, 70, (mpfr_rnd_t) rnd); mpfr_neg (fp, fp, MPFR_RNDN); mpfr_neg (ip, ip, MPFR_RNDN); - check0 (ip, fp, PMAX, (mp_rnd_t) rnd); - check0 (ip, fp, 70, (mp_rnd_t) rnd); + check0 (ip, fp, PMAX, (mpfr_rnd_t) rnd); + check0 (ip, fp, 70, (mpfr_rnd_t) rnd); mpfr_neg (fp, fp, MPFR_RNDN); mpfr_neg (ip, ip, MPFR_RNDN); } diff --git a/tests/tgeneric.c b/tests/tgeneric.c index f301dd700..32660b200 100644 --- a/tests/tgeneric.c +++ b/tests/tgeneric.c @@ -118,7 +118,7 @@ test_generic (mp_prec_t p0, mp_prec_t p1, unsigned int N) mpfr_t u; double d; #endif - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact, compare, compare2; unsigned int n; unsigned long ctrt = 0, ctrn = 0; diff --git a/tests/tgeneric_ui.c b/tests/tgeneric_ui.c index 0f3ec72f0..b214e1f0a 100644 --- a/tests/tgeneric_ui.c +++ b/tests/tgeneric_ui.c @@ -37,7 +37,7 @@ test_generic_ui (mp_prec_t p0, mp_prec_t p1, unsigned int N) mp_prec_t prec, yprec; mpfr_t x, y, z, t; INTEGER_TYPE u; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact, compare, compare2; unsigned int n; diff --git a/tests/tget_d.c b/tests/tget_d.c index 3c4466fbf..6c4d2cda0 100644 --- a/tests/tget_d.c +++ b/tests/tget_d.c @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static int check_denorms (void) { - mp_rnd_t rnd_mode; + mpfr_rnd_t rnd_mode; mpfr_t x; double d, d2, dd, f, dbl_min; int fail = 0, k, n; diff --git a/tests/tget_d_2exp.c b/tests/tget_d_2exp.c index 309304790..d2bb664a5 100644 --- a/tests/tget_d_2exp.c +++ b/tests/tget_d_2exp.c @@ -50,7 +50,7 @@ check_round (void) for (neg = 0; neg <= 1; neg++) { - got = mpfr_get_d_2exp (&got_exp, f, (mp_rnd_t) rnd_mode); + got = mpfr_get_d_2exp (&got_exp, f, (mpfr_rnd_t) rnd_mode); if (neg == 0 ? (got < 0.5 || got >= 1.0) diff --git a/tests/tget_ld_2exp.c b/tests/tget_ld_2exp.c index b39fee40c..1a0da775d 100644 --- a/tests/tget_ld_2exp.c +++ b/tests/tget_ld_2exp.c @@ -50,7 +50,7 @@ check_round (void) for (neg = 0; neg <= 1; neg++) { - got = mpfr_get_ld_2exp (&got_exp, f, (mp_rnd_t) rnd_mode); + got = mpfr_get_ld_2exp (&got_exp, f, (mpfr_rnd_t) rnd_mode); if (neg == 0 ? (got < 0.5 || got >= 1.0) diff --git a/tests/tget_sj.c b/tests/tget_sj.c index 7f918aad6..241193f71 100644 --- a/tests/tget_sj.c +++ b/tests/tget_sj.c @@ -83,12 +83,12 @@ check_sj (intmax_t s, mpfr_ptr x) (MPFR_IS_NEG(y) && i < 0))) continue; /* rint (y) == x == s */ - r = mpfr_get_sj (y, (mp_rnd_t) rnd); + r = mpfr_get_sj (y, (mpfr_rnd_t) rnd); if (r != s) { printf ("Error in check_sj for y = "); mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN); - printf (" in %s\n", mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + printf (" in %s\n", mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf ("Got %jd instead of %jd.\n", r, s); exit (1); } @@ -126,12 +126,12 @@ check_uj (uintmax_t u, mpfr_ptr x) (MPFR_IS_NEG(y) && i < 0))) continue; /* rint (y) == x == u */ - r = mpfr_get_uj (y, (mp_rnd_t) rnd); + r = mpfr_get_uj (y, (mpfr_rnd_t) rnd); if (r != u) { printf ("Error in check_uj for y = "); mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN); - printf (" in %s\n", mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + printf (" in %s\n", mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf ("Got %ju instead of %ju.\n", r, u); exit (1); } diff --git a/tests/tget_str.c b/tests/tget_str.c index 4e023fa81..7444f770d 100644 --- a/tests/tget_str.c +++ b/tests/tget_str.c @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-test.h" static void -check3 (char *d, mp_rnd_t rnd, char *res) +check3 (char *d, mpfr_rnd_t rnd, char *res) { mpfr_t x; char *str; @@ -1105,7 +1105,7 @@ check_special (int b, mp_prec_t p) for (r = 0; r < MPFR_RND_MAX; r++) for (m= (i<3)? 2 : i-1 ; (int) m <= i+1 ; m++) { - mpfr_get_str (s, &e, b, m, x, (mp_rnd_t) r); + mpfr_get_str (s, &e, b, m, x, (mpfr_rnd_t) r); /* s should be 1 followed by (m-1) zeros, and e should be i+1 */ if ((e != i+1) || strncmp (s, s2, m) != 0) { @@ -1119,7 +1119,7 @@ check_special (int b, mp_prec_t p) for (r = 0; r < MPFR_RND_MAX; r++) if (i >= 2) { - mpfr_get_str (s, &e, b, i, x, (mp_rnd_t) r); + mpfr_get_str (s, &e, b, i, x, (mpfr_rnd_t) r); /* should be i times (b-1) */ c = (b <= 10) ? '0' + b - 1 : 'a' + (b - 11); for (j=0; (j < i) && (s[j] == c); j++); @@ -1206,7 +1206,7 @@ main (int argc, char *argv[]) { int b; mpfr_t x; - mp_rnd_t r; + mpfr_rnd_t r; char s[MAX_DIGITS + 2]; mp_exp_t e, f; size_t m; diff --git a/tests/tgmpop.c b/tests/tgmpop.c index f3391ac95..85d80a0ea 100644 --- a/tests/tgmpop.c +++ b/tests/tgmpop.c @@ -150,43 +150,43 @@ check_for_zero (void) i+=MPFR_SIGN_POS-MPFR_SIGN_NEG) { MPFR_SET_SIGN(x, i); - mpfr_add_z (x, x, z, (mp_rnd_t) r); + mpfr_add_z (x, x, z, (mpfr_rnd_t) r); if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i) { printf("GMP Zero errors for add_z & rnd=%s & s=%d\n", - mpfr_print_rnd_mode ((mp_rnd_t) r), i); + mpfr_print_rnd_mode ((mpfr_rnd_t) r), i); mpfr_dump (x); exit (1); } - mpfr_sub_z (x, x, z, (mp_rnd_t) r); + mpfr_sub_z (x, x, z, (mpfr_rnd_t) r); if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i) { printf("GMP Zero errors for sub_z & rnd=%s & s=%d\n", - mpfr_print_rnd_mode ((mp_rnd_t) r), i); + mpfr_print_rnd_mode ((mpfr_rnd_t) r), i); mpfr_dump (x); exit (1); } - mpfr_mul_z (x, x, z, (mp_rnd_t) r); + mpfr_mul_z (x, x, z, (mpfr_rnd_t) r); if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i) { printf("GMP Zero errors for mul_z & rnd=%s & s=%d\n", - mpfr_print_rnd_mode ((mp_rnd_t) r), i); + mpfr_print_rnd_mode ((mpfr_rnd_t) r), i); mpfr_dump (x); exit (1); } - mpfr_add_q (x, x, q, (mp_rnd_t) r); + mpfr_add_q (x, x, q, (mpfr_rnd_t) r); if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i) { printf("GMP Zero errors for add_q & rnd=%s & s=%d\n", - mpfr_print_rnd_mode ((mp_rnd_t) r), i); + mpfr_print_rnd_mode ((mpfr_rnd_t) r), i); mpfr_dump (x); exit (1); } - mpfr_sub_q (x, x, q, (mp_rnd_t) r); + mpfr_sub_q (x, x, q, (mpfr_rnd_t) r); if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i) { printf("GMP Zero errors for sub_q & rnd=%s & s=%d\n", - mpfr_print_rnd_mode ((mp_rnd_t) r), i); + mpfr_print_rnd_mode ((mpfr_rnd_t) r), i); mpfr_dump (x); exit (1); } @@ -315,7 +315,7 @@ test_cmp_f (mp_prec_t pmin, mp_prec_t pmax, int nmax) } static void -test_specialz (int (*mpfr_func)(mpfr_ptr, mpfr_srcptr, mpz_srcptr, mp_rnd_t), +test_specialz (int (*mpfr_func)(mpfr_ptr, mpfr_srcptr, mpz_srcptr, mpfr_rnd_t), void (*mpz_func)(mpz_ptr, mpz_srcptr, mpz_srcptr), const char *op) { @@ -391,13 +391,13 @@ test_specialz (int (*mpfr_func)(mpfr_ptr, mpfr_srcptr, mpz_srcptr, mp_rnd_t), static void test_genericz (mp_prec_t p0, mp_prec_t p1, unsigned int N, - int (*func)(mpfr_ptr, mpfr_srcptr, mpz_srcptr, mp_rnd_t), + int (*func)(mpfr_ptr, mpfr_srcptr, mpz_srcptr, mpfr_rnd_t), const char *op) { mp_prec_t prec; mpfr_t arg1, dst_big, dst_small, tmp; mpz_t arg2; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact, compare, compare2; unsigned int n; @@ -468,13 +468,13 @@ 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, - int (*func)(mpfr_ptr, mpfr_srcptr, mpq_srcptr, mp_rnd_t), + int (*func)(mpfr_ptr, mpfr_srcptr, mpq_srcptr, mpfr_rnd_t), const char *op) { mp_prec_t prec; mpfr_t arg1, dst_big, dst_small, tmp; mpq_t arg2; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact, compare, compare2; unsigned int n; @@ -548,7 +548,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, - int (*mpfr_func)(mpfr_ptr, mpfr_srcptr, mpq_srcptr, mp_rnd_t), + int (*mpfr_func)(mpfr_ptr, mpfr_srcptr, mpq_srcptr, mpfr_rnd_t), void (*mpq_func)(mpq_ptr, mpq_srcptr, mpq_srcptr), const char *op) { diff --git a/tests/thypot.c b/tests/thypot.c index 3f5bdd316..ef44433cc 100644 --- a/tests/thypot.c +++ b/tests/thypot.c @@ -220,12 +220,12 @@ test_large_small (void) { mpfr_set_ui_2exp (x, 1, mpfr_get_emax () - 1, MPFR_RNDN); mpfr_set_ui_2exp (y, 1, mpfr_get_emin (), MPFR_RNDN); - inexact = mpfr_hypot (z, x, y, (mp_rnd_t) r); - inex2 = mpfr_add_ui (y, x, 1, (mp_rnd_t) r); + inexact = mpfr_hypot (z, x, y, (mpfr_rnd_t) r); + inex2 = mpfr_add_ui (y, x, 1, (mpfr_rnd_t) r); if (! mpfr_equal_p (y, z) || ! SAME_SIGN (inexact, inex2)) { printf ("Error 3 in test_large_small, %s%s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r), + mpfr_print_rnd_mode ((mpfr_rnd_t) r), ext ? ", extended exponent range" : ""); printf ("Expected "); mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN); @@ -255,11 +255,11 @@ check_overflow (void) RND_LOOP(r) { mpfr_clear_overflow (); - inex = mpfr_hypot (y, x, x, (mp_rnd_t) r); + inex = mpfr_hypot (y, x, x, (mpfr_rnd_t) r); if (!mpfr_overflow_p ()) { printf ("No overflow in check_overflow for %s%s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r), + mpfr_print_rnd_mode ((mpfr_rnd_t) r), ext ? ", extended exponent range" : ""); exit (1); } diff --git a/tests/tinternals.c b/tests/tinternals.c index 141ee3835..333ba81b5 100644 --- a/tests/tinternals.c +++ b/tests/tinternals.c @@ -72,7 +72,7 @@ test_round_near_x (void) for (dir = 0; dir <= 1; dir++) RND_LOOP(r) { - inex = mpfr_round_near_x (y, x, err, dir, (mp_rnd_t) r); + inex = mpfr_round_near_x (y, x, err, dir, (mpfr_rnd_t) r); if (inex == 0 && err < 6) { @@ -82,7 +82,7 @@ test_round_near_x (void) } inex2 = ((dir ^ neg) ? mpfr_add : mpfr_sub) - (z, x, eps, (mp_rnd_t) r); + (z, x, eps, (mpfr_rnd_t) r); if (inex * inex2 <= 0) printf ("Bad return value (%d instead of %d) for:\n", inex, inex2); @@ -103,7 +103,7 @@ test_round_near_x (void) printf ("x = %c%c%c%c.%c%c, ", neg ? '-' : '+', p[0], p[1], p[2], p[3], p[4]); printf ("err = %d, dir = %d, r = %s --> inex = %2d", - err, dir, mpfr_print_rnd_mode ((mp_rnd_t) r), inex); + err, dir, mpfr_print_rnd_mode ((mpfr_rnd_t) r), inex); if (inex != 0) { printf (", y = "); diff --git a/tests/tlgamma.c b/tests/tlgamma.c index b7829f8a0..016156eb1 100644 --- a/tests/tlgamma.c +++ b/tests/tlgamma.c @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-test.h" static int -mpfr_lgamma_nosign (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd) +mpfr_lgamma_nosign (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) { int inex, sign; @@ -381,7 +381,7 @@ special (void) } static int -mpfr_lgamma1 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t r) +mpfr_lgamma1 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t r) { int sign; diff --git a/tests/tlog.c b/tests/tlog.c index ce615c561..dda596251 100644 --- a/tests/tlog.c +++ b/tests/tlog.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_log (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +test_log (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_get_prec (a)>=53; @@ -49,7 +49,7 @@ test_log (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) #endif static void -check2 (const char *as, mp_rnd_t rnd_mode, const char *res1s) +check2 (const char *as, mpfr_rnd_t rnd_mode, const char *res1s) { mpfr_t ta, tres; @@ -70,7 +70,7 @@ check2 (const char *as, mp_rnd_t rnd_mode, const char *res1s) } static void -check3 (double d, unsigned long prec, mp_rnd_t rnd) +check3 (double d, unsigned long prec, mpfr_rnd_t rnd) { mpfr_t x, y; @@ -279,7 +279,7 @@ main (int argc, char *argv[]) if (argc==4) { /* tlog x prec rnd */ - check3 (atof(argv[1]), atoi(argv[2]), (mp_rnd_t) atoi(argv[3])); + check3 (atof(argv[1]), atoi(argv[2]), (mpfr_rnd_t) atoi(argv[3])); goto done; } diff --git a/tests/tlog10.c b/tests/tlog10.c index 4017b8a08..93aa9d320 100644 --- a/tests/tlog10.c +++ b/tests/tlog10.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_log10 (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +test_log10 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_get_prec (a)>=53; diff --git a/tests/tlog1p.c b/tests/tlog1p.c index 7c913b3a6..4f88b4f5f 100644 --- a/tests/tlog1p.c +++ b/tests/tlog1p.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_log1p (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +test_log1p (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_get_prec (a)>=53; diff --git a/tests/tmodf.c b/tests/tmodf.c index 68690e20d..52c27e05c 100644 --- a/tests/tmodf.c +++ b/tests/tmodf.c @@ -30,7 +30,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, - int expected_return, mp_rnd_t rnd_mode) + int expected_return, mpfr_rnd_t rnd_mode) { int inexact; mpfr_t xi, xf, x; diff --git a/tests/tmul.c b/tests/tmul.c index 2b1a80b77..3bd866cdf 100644 --- a/tests/tmul.c +++ b/tests/tmul.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +test_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_number_p (c); @@ -55,7 +55,7 @@ test_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) /* checks that x*y gives the right result */ static void -pcheck (const char *xs, const char *ys, const char *res, mp_rnd_t rnd_mode, +pcheck (const char *xs, const char *ys, const char *res, mpfr_rnd_t rnd_mode, unsigned int px, unsigned int py, unsigned int pz) { mpfr_t xx, yy, zz; @@ -89,7 +89,7 @@ pcheck (const char *xs, const char *ys, const char *res, mp_rnd_t rnd_mode, } static void -check53 (const char *xs, const char *ys, mp_rnd_t rnd_mode, const char *zs) +check53 (const char *xs, const char *ys, mpfr_rnd_t rnd_mode, const char *zs) { mpfr_t xx, yy, zz; @@ -121,7 +121,7 @@ check53 (const char *xs, const char *ys, mp_rnd_t rnd_mode, const char *zs) /* checks that x*y gives the right result with 24 bits of precision */ static void -check24 (const char *xs, const char *ys, mp_rnd_t rnd_mode, const char *zs) +check24 (const char *xs, const char *ys, mpfr_rnd_t rnd_mode, const char *zs) { mpfr_t xx, yy, zz; @@ -215,7 +215,7 @@ check_exact (void) mpfr_t a, b, c, d; mp_prec_t prec; int i, inexact; - mp_rnd_t rnd; + mpfr_rnd_t rnd; mpfr_init (a); mpfr_init (b); @@ -616,7 +616,7 @@ check_regression (void) /* multiplies x by 53-bit approximation of Pi */ static int -mpfr_mulpi (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t r) +mpfr_mulpi (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t r) { mpfr_t z; int inex; diff --git a/tests/tmul_2exp.c b/tests/tmul_2exp.c index dbc37b7d4..b8d27de1b 100644 --- a/tests/tmul_2exp.c +++ b/tests/tmul_2exp.c @@ -36,7 +36,7 @@ static const char * const val[] = { static int test_mul (int i, int div, mpfr_ptr y, mpfr_srcptr x, - unsigned long int n, mp_rnd_t r) + unsigned long int n, mpfr_rnd_t r) { return i == 0 ? (div ? mpfr_div_2ui : mpfr_mul_2ui) (y, x, n, r) : diff --git a/tests/tmul_ui.c b/tests/tmul_ui.c index 24a5fa194..37be00577 100644 --- a/tests/tmul_ui.c +++ b/tests/tmul_ui.c @@ -49,7 +49,7 @@ check_inexact (mp_prec_t p) for (rnd = 0; rnd < MPFR_RND_MAX; rnd++) { mpfr_set_prec (y, q); - inexact = mpfr_mul_ui (y, x, u, (mp_rnd_t) rnd); + inexact = mpfr_mul_ui (y, x, u, (mpfr_rnd_t) rnd); cmp = mpfr_cmp (y, z); if (((inexact == 0) && (cmp != 0)) || ((inexact < 0) && (cmp >= 0)) || @@ -57,7 +57,7 @@ check_inexact (mp_prec_t p) { printf ("Wrong inexact flag for p=%u, q=%u, rnd=%s\n", (unsigned int) p, (unsigned int) q, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); exit (1); } } diff --git a/tests/tout_str.c b/tests/tout_str.c index e01b4faa5..6bd11a9f0 100644 --- a/tests/tout_str.c +++ b/tests/tout_str.c @@ -30,7 +30,7 @@ FILE *fout; #define check(d,r,b) check4(d,r,b,53) static void -check4 (double d, mp_rnd_t rnd, int base, int prec) +check4 (double d, mpfr_rnd_t rnd, int base, int prec) { mpfr_t x; @@ -70,7 +70,7 @@ int main (int argc, char *argv[]) { int i, N=10000, p; - mp_rnd_t rnd; + mpfr_rnd_t rnd; double d; tests_start_mpfr (); diff --git a/tests/toutimpl.c b/tests/toutimpl.c index b15685e41..48c9cc16d 100644 --- a/tests/toutimpl.c +++ b/tests/toutimpl.c @@ -65,7 +65,7 @@ main (void) printf ("Error for printing MPFR_RNDZ\n"); exit (1); } - if (mpfr_print_rnd_mode ((mp_rnd_t) -1) != NULL || + if (mpfr_print_rnd_mode ((mpfr_rnd_t) -1) != NULL || mpfr_print_rnd_mode (MPFR_RND_MAX) != NULL) { printf ("Error for illegal rounding mode values.\n"); diff --git a/tests/tpow.c b/tests/tpow.c index 2591d1a4a..f1a8afe01 100644 --- a/tests/tpow.c +++ b/tests/tpow.c @@ -30,7 +30,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_pow (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +test_pow (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_number_p (c) @@ -431,15 +431,15 @@ check_inexact (mp_prec_t p) mpfr_set_prec (y, q); mpfr_set_prec (z, q + 10); mpfr_set_prec (t, q); - inexact = mpfr_pow_ui (y, x, u, (mp_rnd_t) rnd); - cmp = mpfr_pow_ui (z, x, u, (mp_rnd_t) rnd); - if (mpfr_can_round (z, q + 10, (mp_rnd_t) rnd, (mp_rnd_t) rnd, q)) + inexact = mpfr_pow_ui (y, x, u, (mpfr_rnd_t) rnd); + cmp = mpfr_pow_ui (z, x, u, (mpfr_rnd_t) rnd); + if (mpfr_can_round (z, q + 10, (mpfr_rnd_t) rnd, (mpfr_rnd_t) rnd, q)) { - cmp = mpfr_set (t, z, (mp_rnd_t) rnd) || cmp; + cmp = mpfr_set (t, z, (mpfr_rnd_t) rnd) || cmp; if (mpfr_cmp (y, t)) { printf ("results differ for u=%lu rnd=%s\n", - u, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + u, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf ("x="); mpfr_print_binary (x); puts (""); printf ("y="); mpfr_print_binary (y); puts (""); printf ("t="); mpfr_print_binary (t); puts (""); @@ -451,7 +451,7 @@ check_inexact (mp_prec_t p) { printf ("Wrong inexact flag for p=%u, q=%u, rnd=%s\n", (unsigned int) p, (unsigned int) q, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf ("expected %d, got %d\n", cmp, inexact); printf ("u=%lu x=", u); mpfr_print_binary (x); puts (""); printf ("y="); mpfr_print_binary (y); puts (""); @@ -1037,7 +1037,7 @@ x_near_one (void) } static int -mpfr_pow275 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t r) +mpfr_pow275 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t r) { mpfr_t z; int inex; @@ -1278,14 +1278,14 @@ bug20080721 (void) i = (rnd == MPFR_RNDN || rnd == MPFR_RNDD || rnd == MPFR_RNDA); inex0 = i ? -1 : 1; mpfr_clear_flags (); - inex = mpfr_pow (z, x, y, (mp_rnd_t) rnd); + inex = mpfr_pow (z, x, y, (mpfr_rnd_t) rnd); if (__gmpfr_flags != MPFR_FLAGS_INEXACT || ! SAME_SIGN (inex, inex0) || MPFR_IS_NAN (z) || mpfr_cmp (z, t[i]) != 0) { unsigned int flags = __gmpfr_flags; printf ("Error in bug20080721 with %s\n", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf ("expected "); mpfr_out_str (stdout, 2, 0, t[i], MPFR_RNDN); printf (", inex = %d, flags = %u\n", inex0, diff --git a/tests/tpow3.c b/tests/tpow3.c index 230698f81..f74787968 100644 --- a/tests/tpow3.c +++ b/tests/tpow3.c @@ -34,7 +34,7 @@ main (int argc, char *argv[]) mp_prec_t prec, yprec; mpfr_t t, s; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact, compare, compare2; unsigned int n, err; diff --git a/tests/tpow_all.c b/tests/tpow_all.c index a2ba5f569..006a95bae 100644 --- a/tests/tpow_all.c +++ b/tests/tpow_all.c @@ -54,7 +54,7 @@ err (const char *s, int i, int j, int rnd, mpfr_srcptr z, int inex) if (ext) puts ("extended exponent range"); printf ("x = %s, y = %s, %s\n", val[i], val[j], - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf ("z = "); mpfr_out_str (stdout, 10, 0, z, MPFR_RNDN); printf ("\ninex = %d\n", inex); @@ -74,7 +74,7 @@ err (const char *s, int i, int j, int rnd, mpfr_srcptr z, int inex) * s1, s2: strings about the context. */ static void -cmpres (int spx, const void *px, const char *sy, mp_rnd_t rnd, +cmpres (int spx, const void *px, const char *sy, mpfr_rnd_t rnd, mpfr_srcptr z1, int inex1, mpfr_srcptr z2, int inex2, unsigned int flags1, const char *s1, const char *s2) { @@ -140,7 +140,7 @@ is_odd (mpfr_srcptr x) rounding mode; s is a string containing the function that called test_others. */ static void -test_others (const void *sx, const char *sy, mp_rnd_t rnd, +test_others (const void *sx, const char *sy, mpfr_rnd_t rnd, mpfr_srcptr x, mpfr_srcptr y, mpfr_srcptr z1, int inex1, unsigned int flags, const char *s) { @@ -380,7 +380,7 @@ tst (void) exit (1); } mpfr_clear_flags (); - inex = mpfr_pow (z, x, y, (mp_rnd_t) rnd); + inex = mpfr_pow (z, x, y, (mpfr_rnd_t) rnd); flags = __gmpfr_flags; if (! MPFR_IS_NAN (z) && mpfr_nanflag_p ()) err ("got NaN flag without NaN value", i, j, rnd, z, inex); @@ -456,7 +456,7 @@ tst (void) if ((MPFR_IS_NEG (x) && is_odd (y)) ^ MPFR_IS_NEG (z)) err ("wrong sign", i, j, rnd, z, inex); } - test_others (val[i], val[j], (mp_rnd_t) rnd, x, y, z, inex, flags, + test_others (val[i], val[j], (mpfr_rnd_t) rnd, x, y, z, inex, flags, "tst"); } mpfr_clears (x, y, z, tmp, (mpfr_ptr) 0); @@ -517,10 +517,10 @@ underflow_up1 (void) (i >= 8 && rnd == MPFR_RNDN); mpfr_clear_flags (); - inex = mpfr_pow (z, x, y, (mp_rnd_t) rnd); - cmpres (1, "2", sy, (mp_rnd_t) rnd, zero ? z0 : (mpfr_ptr) NULL, + inex = mpfr_pow (z, x, y, (mpfr_rnd_t) rnd); + cmpres (1, "2", sy, (mpfr_rnd_t) rnd, zero ? z0 : (mpfr_ptr) NULL, -1, z, inex, flags, "underflow_up1", "mpfr_pow"); - test_others ("2", sy, (mp_rnd_t) rnd, x, y, z, inex, flags, + test_others ("2", sy, (mpfr_rnd_t) rnd, x, y, z, inex, flags, "underflow_up1"); } @@ -589,10 +589,10 @@ underflow_up2 (void) sprintf (sy, "%lu", (unsigned long) n); mpfr_clear_flags (); - inex = mpfr_pow (z, x, y, (mp_rnd_t) rnd); - cmpres (0, x, sy, (mp_rnd_t) rnd, z0, expected_inex, z, inex, ufinex, + inex = mpfr_pow (z, x, y, (mpfr_rnd_t) rnd); + cmpres (0, x, sy, (mpfr_rnd_t) rnd, z0, expected_inex, z, inex, ufinex, "underflow_up2", "mpfr_pow"); - test_others (NULL, sy, (mp_rnd_t) rnd, x, y, z, inex, ufinex, + test_others (NULL, sy, (mpfr_rnd_t) rnd, x, y, z, inex, ufinex, "underflow_up2"); } @@ -635,10 +635,10 @@ underflow_up3 (void) mpfr_nextabove (z0); mpfr_clear_flags (); - inex = mpfr_pow (z, x, y, (mp_rnd_t) rnd); - cmpres (0, x, "emin - 2", (mp_rnd_t) rnd, z0, expected_inex, z, inex, + inex = mpfr_pow (z, x, y, (mpfr_rnd_t) rnd); + cmpres (0, x, "emin - 2", (mpfr_rnd_t) rnd, z0, expected_inex, z, inex, ufinex, "underflow_up3", "mpfr_pow"); - test_others (NULL, "emin - 2", (mp_rnd_t) rnd, x, y, z, inex, ufinex, + test_others (NULL, "emin - 2", (mpfr_rnd_t) rnd, x, y, z, inex, ufinex, "underflow_up3"); } @@ -694,7 +694,7 @@ overflow_inv (void) RND_LOOP (rnd) { int inf, overflow; - mp_rnd_t rnd2; + mpfr_rnd_t rnd2; if (rnd == MPFR_RNDA) rnd2 = s < 0 ? MPFR_RNDD : MPFR_RNDU; @@ -702,20 +702,20 @@ overflow_inv (void) rnd2 = rnd; overflow = t == 0 || - ((mp_rnd_t) rnd == MPFR_RNDN && (precx > 10 || t == 1)) || - ((mp_rnd_t) rnd2 == (s < 0 ? MPFR_RNDD : MPFR_RNDU) && + ((mpfr_rnd_t) rnd == MPFR_RNDN && (precx > 10 || t == 1)) || + ((mpfr_rnd_t) rnd2 == (s < 0 ? MPFR_RNDD : MPFR_RNDU) && (precx > 10 || t <= 2)); inf = overflow && - ((mp_rnd_t) rnd == MPFR_RNDN || - (mp_rnd_t) rnd2 == (s < 0 ? MPFR_RNDD : MPFR_RNDU)); + ((mpfr_rnd_t) rnd == MPFR_RNDN || + (mpfr_rnd_t) rnd2 == (s < 0 ? MPFR_RNDD : MPFR_RNDU)); mpfr_clear_flags (); - inex = mpfr_pow (z, x, y, (mp_rnd_t) rnd); + inex = mpfr_pow (z, x, y, (mpfr_rnd_t) rnd); if (overflow ^ !! mpfr_overflow_p ()) { printf ("Bad overflow flag in %s\nfor mpfr_pow%s\n" "s = %d, t = %d, %s\n", sp, ext ? ", extended exponent range" : "", - s, t, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + s, t, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); exit (1); } if (overflow && (inf ^ !! MPFR_IS_INF (z))) @@ -723,13 +723,13 @@ overflow_inv (void) printf ("Bad value in %s\nfor mpfr_pow%s\n" "s = %d, t = %d, %s\nGot ", sp, ext ? ", extended exponent range" : "", - s, t, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + s, t, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_out_str (stdout, 16, 0, z, MPFR_RNDN); printf (" instead of %s value.\n", inf ? "infinite" : "finite"); exit (1); } - test_others (NULL, "-1", (mp_rnd_t) rnd, x, y, z, + test_others (NULL, "-1", (mpfr_rnd_t) rnd, x, y, z, inex, __gmpfr_flags, sp); } /* RND_LOOP */ mpfr_nexttoinf (x); diff --git a/tests/tpow_z.c b/tests/tpow_z.c index c9d866809..ebbd718dc 100644 --- a/tests/tpow_z.c +++ b/tests/tpow_z.c @@ -145,7 +145,7 @@ check_integer (mp_prec_t begin, mp_prec_t end, unsigned long max) unsigned long i, n; mp_prec_t p; int res1, res2; - mp_rnd_t rnd; + mpfr_rnd_t rnd; mpfr_inits2 (begin, x, y1, y2, (mpfr_ptr) 0); mpz_init (z); diff --git a/tests/tprintf.c b/tests/tprintf.c index 7fd06aef3..2b586bec5 100644 --- a/tests/tprintf.c +++ b/tests/tprintf.c @@ -247,7 +247,7 @@ check_mixed (void) mpz_t mpz; mpq_t mpq; mpf_t mpf; - mp_rnd_t rnd = MPFR_RNDN; + mpfr_rnd_t rnd = MPFR_RNDN; mpfr_t mpfr; mpfr_prec_t prec; @@ -328,7 +328,7 @@ check_random (int nb_tests) { int i; mpfr_t x; - mp_rnd_t rnd; + mpfr_rnd_t rnd; char flag[] = { '-', @@ -363,7 +363,7 @@ check_random (int nb_tests) char *ptr = fmt; tests_default_random (x, 256, MPFR_EMIN_MIN, MPFR_EMAX_MAX); - rnd = (mp_rnd_t) RND_RAND (); + rnd = (mpfr_rnd_t) RND_RAND (); spec = (int) (randlimb () % 5); jmax = (spec == 3 || spec == 4) ? 6 : 5; /* ' flag only with %f or %g */ diff --git a/tests/trec_sqrt.c b/tests/trec_sqrt.c index e1776cfe2..7254adcaa 100644 --- a/tests/trec_sqrt.c +++ b/tests/trec_sqrt.c @@ -114,7 +114,7 @@ bad_case1 (void) } static int -pm2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) +pm2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { return mpfr_pow_si (y, x, -2, rnd_mode); } diff --git a/tests/trint.c b/tests/trint.c index f99d03298..58789daca 100644 --- a/tests/trint.c +++ b/tests/trint.c @@ -153,7 +153,7 @@ special (void) #if __MPFR_STDC (199901L) static void -test_fct (double (*f)(double), int (*g)(), char *s, mp_rnd_t r) +test_fct (double (*f)(double), int (*g)(), char *s, mpfr_rnd_t r) { double d, y; mpfr_t dd, yy; @@ -187,7 +187,7 @@ test_fct (double (*f)(double), int (*g)(), char *s, mp_rnd_t r) static void test_against_libc (void) { - mp_rnd_t r = MPFR_RNDN; + mpfr_rnd_t r = MPFR_RNDN; #if HAVE_ROUND TEST_FCT (round); @@ -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, mp_rnd_t r, +err (char *str, mp_size_t s, mpfr_t x, mpfr_t y, mp_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 = ", @@ -272,7 +272,7 @@ main (int argc, char *argv[]) for (trint = 0; trint < 3; trint++) { if (trint == 2) - inexact = mpfr_rint (y, x, (mp_rnd_t) r); + inexact = mpfr_rint (y, x, (mpfr_rnd_t) r); else if (r == MPFR_RNDN) inexact = mpfr_round (y, x); else if (r == MPFR_RNDZ) @@ -286,13 +286,13 @@ main (int argc, char *argv[]) mpfr_rint_floor (y, x, MPFR_RNDD)); if (mpfr_sub (t, y, x, MPFR_RNDN)) err ("subtraction 1 should be exact", - s, x, y, p, (mp_rnd_t) r, trint, inexact); + s, x, y, p, (mpfr_rnd_t) r, trint, inexact); sign_t = mpfr_cmp_ui (t, 0); if (trint != 0 && (((inexact == 0) && (sign_t != 0)) || ((inexact < 0) && (sign_t >= 0)) || ((inexact > 0) && (sign_t <= 0)))) - err ("wrong inexact flag", s, x, y, p, (mp_rnd_t) r, trint, inexact); + err ("wrong inexact flag", s, x, y, p, (mpfr_rnd_t) r, trint, inexact); if (inexact == 0) continue; /* end of the test for exact results */ @@ -301,31 +301,31 @@ main (int argc, char *argv[]) ((r == MPFR_RNDU || (r == MPFR_RNDZ && MPFR_SIGN (x) < 0)) && inexact < 0)) err ("wrong rounding direction", - s, x, y, p, (mp_rnd_t) r, trint, inexact); + s, x, y, p, (mpfr_rnd_t) r, trint, inexact); if (inexact < 0) { mpfr_add_ui (v, y, 1, MPFR_RNDU); if (mpfr_cmp (v, x) <= 0) err ("representable integer between x and its " - "rounded value", s, x, y, p, (mp_rnd_t) r, trint, inexact); + "rounded value", s, x, y, p, (mpfr_rnd_t) r, trint, inexact); } else { mpfr_sub_ui (v, y, 1, MPFR_RNDD); if (mpfr_cmp (v, x) >= 0) err ("representable integer between x and its " - "rounded value", s, x, y, p, (mp_rnd_t) r, trint, inexact); + "rounded value", s, x, y, p, (mpfr_rnd_t) r, trint, inexact); } if (r == MPFR_RNDN) { int cmp; if (mpfr_sub (u, v, x, MPFR_RNDN)) err ("subtraction 2 should be exact", - s, x, y, p, (mp_rnd_t) r, trint, inexact); + s, x, y, p, (mpfr_rnd_t) r, trint, inexact); cmp = mpfr_cmp_abs (t, u); if (cmp > 0) err ("faithful rounding, but not the nearest integer", - s, x, y, p, (mp_rnd_t) r, trint, inexact); + s, x, y, p, (mpfr_rnd_t) r, trint, inexact); if (cmp < 0) continue; /* |t| = |u|: x is the middle of two consecutive @@ -337,7 +337,7 @@ main (int argc, char *argv[]) mpfr_div_2ui (y, y, 1, MPFR_RNDZ); if (!mpfr_integer_p (y)) err ("halfway case for mpfr_rint, result isn't an" - " even integer", s, x, y, p, (mp_rnd_t) r, trint, inexact); + " even integer", s, x, y, p, (mpfr_rnd_t) r, trint, inexact); /* If floor(x) and ceil(x) aren't both representable integers, the mantissa must be even. */ mpfr_sub (v, v, y, MPFR_RNDN); @@ -348,7 +348,7 @@ main (int argc, char *argv[]) + 1, MPFR_RNDN); if (!mpfr_integer_p (y)) err ("halfway case for mpfr_rint, mantissa isn't" - " even", s, x, y, p, (mp_rnd_t) r, trint, inexact); + " even", s, x, y, p, (mpfr_rnd_t) r, trint, inexact); } } else @@ -357,7 +357,7 @@ main (int argc, char *argv[]) if ((MPFR_SIGN (x) > 0 && inexact < 0) || (MPFR_SIGN (x) < 0 && inexact > 0)) err ("halfway case for mpfr_round, bad rounding" - " direction", s, x, y, p, (mp_rnd_t) r, trint, inexact); + " direction", s, x, y, p, (mpfr_rnd_t) r, trint, inexact); } } } diff --git a/tests/troot.c b/tests/troot.c index f70f5144d..0d55fe908 100644 --- a/tests/troot.c +++ b/tests/troot.c @@ -281,11 +281,11 @@ main (void) { mpfr_set_ui (x, 1, MPFR_RNDN); k = 2 + randlimb () % 4; /* 2 <= k <= 5 */ - mpfr_root (x, x, k, (mp_rnd_t) r); + mpfr_root (x, x, k, (mpfr_rnd_t) r); if (mpfr_cmp_ui (x, 1)) { printf ("Error in mpfr_root(%lu) for x=1, rnd=%s\ngot ", - k, mpfr_print_rnd_mode ((mp_rnd_t) r)); + k, mpfr_print_rnd_mode ((mpfr_rnd_t) r)); mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN); printf ("\n"); exit (1); @@ -293,11 +293,11 @@ main (void) mpfr_set_si (x, -1, MPFR_RNDN); if (k % 2) { - mpfr_root (x, x, k, (mp_rnd_t) r); + mpfr_root (x, x, k, (mpfr_rnd_t) r); if (mpfr_cmp_si (x, -1)) { printf ("Error in mpfr_root(%lu) for x=-1, rnd=%s\ngot ", - k, mpfr_print_rnd_mode ((mp_rnd_t) r)); + k, mpfr_print_rnd_mode ((mpfr_rnd_t) r)); mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN); printf ("\n"); exit (1); @@ -316,7 +316,7 @@ main (void) { printf ("Error in mpfr_root(3) for " "x = 27.0 * 2^(%d), rnd=%s\ngot ", - 3*i, mpfr_print_rnd_mode ((mp_rnd_t) r)); + 3*i, mpfr_print_rnd_mode ((mpfr_rnd_t) r)); mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN); printf ("\ninstead of 3 * 2^(%d)\n", i); exit (1); diff --git a/tests/tsec.c b/tests/tsec.c index d8032d374..6f5ad0162 100644 --- a/tests/tsec.c +++ b/tests/tsec.c @@ -103,12 +103,12 @@ overflowed_sec0 (void) { mpfr_set_si_2exp (x, i, -512 * ABS (i), MPFR_RNDN); mpfr_clear_flags (); - inex = mpfr_sec (x, x, (mp_rnd_t) rnd); + inex = mpfr_sec (x, x, (mpfr_rnd_t) rnd); if (! mpfr_overflow_p ()) { printf ("Error in overflowed_sec0 (i = %d, rnd = %s):\n" " The overflow flag is not set.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (rnd == MPFR_RNDZ || rnd == MPFR_RNDD) @@ -117,13 +117,13 @@ overflowed_sec0 (void) { printf ("Error in overflowed_sec0 (i = %d, rnd = %s):\n" " The inexact value must be negative.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (x, y)) { printf ("Error in overflowed_sec0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of 0.11111111E%d.\n", emax); err = 1; @@ -135,13 +135,13 @@ overflowed_sec0 (void) { printf ("Error in overflowed_sec0 (i = %d, rnd = %s):\n" " The inexact value must be positive.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! (mpfr_inf_p (x) && MPFR_SIGN (x) > 0)) { printf ("Error in overflowed_sec0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of +Inf.\n"); err = 1; diff --git a/tests/tsech.c b/tests/tsech.c index bb2e44679..c49482436 100644 --- a/tests/tsech.c +++ b/tests/tsech.c @@ -121,13 +121,13 @@ overflowed_sech0 (void) { mpfr_set_si_2exp (x, i, -512 * ABS (i), MPFR_RNDN); mpfr_clear_flags (); - inex = mpfr_sech (x, x, (mp_rnd_t) rnd); + inex = mpfr_sech (x, x, (mpfr_rnd_t) rnd); if ((i == 0 || emax < 0 || rnd == MPFR_RNDN || rnd == MPFR_RNDU) && ! mpfr_overflow_p ()) { printf ("Error in overflowed_sech0 (i = %d, rnd = %s):\n" " The overflow flag is not set.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (rnd == MPFR_RNDZ || rnd == MPFR_RNDD) @@ -136,13 +136,13 @@ overflowed_sech0 (void) { printf ("Error in overflowed_sech0 (i = %d, rnd = %s):\n" " The inexact value must be negative.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (x, y)) { printf ("Error in overflowed_sech0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of 0.11111111E%d.\n", emax); err = 1; @@ -154,13 +154,13 @@ overflowed_sech0 (void) { printf ("Error in overflowed_sech0 (i = %d, rnd = %s):\n" " The inexact value must be positive.\n", - i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! (mpfr_inf_p (x) && MPFR_SIGN (x) > 0)) { printf ("Error in overflowed_sech0 (i = %d, rnd = %s):\n" - " Got ", i, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got ", i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of +Inf.\n"); err = 1; diff --git a/tests/tset.c b/tests/tset.c index 740a4e721..0ab66078b 100644 --- a/tests/tset.c +++ b/tests/tset.c @@ -123,7 +123,7 @@ main (void) mpfr_set_prec (y, q); for (rnd = 0; rnd < MPFR_RND_MAX; rnd++) { - inexact = mpfr_set (y, x, (mp_rnd_t) rnd); + inexact = mpfr_set (y, x, (mpfr_rnd_t) rnd); cmp = mpfr_cmp (y, x); if (((inexact == 0) && (cmp != 0)) || ((inexact > 0) && (cmp <= 0)) || diff --git a/tests/tset_d.c b/tests/tset_d.c index 935eed8a5..4577b0f19 100644 --- a/tests/tset_d.c +++ b/tests/tset_d.c @@ -159,7 +159,7 @@ main (int argc, char *argv[]) } mpfr_init2 (z, 32); - mpfr_set_d (z, 1.0, (mp_rnd_t) 0); + mpfr_set_d (z, 1.0, (mpfr_rnd_t) 0); if (mpfr_cmp_ui (z, 1)) { mpfr_print_binary (z); puts (""); @@ -168,7 +168,7 @@ main (int argc, char *argv[]) } mpfr_set_prec (x, 53); mpfr_init2 (y, 53); - mpfr_set_d (x, d=-1.08007920352320089721e+150, (mp_rnd_t) 0); + mpfr_set_d (x, d=-1.08007920352320089721e+150, (mpfr_rnd_t) 0); if (mpfr_get_d1 (x) != d) { mpfr_print_binary (x); puts (""); @@ -177,9 +177,9 @@ main (int argc, char *argv[]) exit (1); } - mpfr_set_d (x, 8.06294740693074521573e-310, (mp_rnd_t) 0); + mpfr_set_d (x, 8.06294740693074521573e-310, (mpfr_rnd_t) 0); d = -6.72658901114033715233e-165; - mpfr_set_d (x, d, (mp_rnd_t) 0); + mpfr_set_d (x, d, (mpfr_rnd_t) 0); if (d != mpfr_get_d1 (x)) { mpfr_print_binary (x); @@ -201,7 +201,7 @@ main (int argc, char *argv[]) #else while (ABS(d) < DBL_MIN); #endif - mpfr_set_d (x, d, (mp_rnd_t) 0); + mpfr_set_d (x, d, (mpfr_rnd_t) 0); dd = mpfr_get_d1 (x); if (d != dd && !(Isnan(d) && Isnan(dd))) { diff --git a/tests/tset_f.c b/tests/tset_f.c index aeca58e0a..a095105ef 100644 --- a/tests/tset_f.c +++ b/tests/tset_f.c @@ -134,11 +134,11 @@ main (void) { if (i) mpfr_set_si (x, i, MPFR_RNDN); - inexact = mpfr_set_f (x, y, (mp_rnd_t) r); + inexact = mpfr_set_f (x, y, (mpfr_rnd_t) r); if (!MPFR_IS_ZERO(x) || !MPFR_IS_POS(x) || inexact) { printf ("mpfr_set_f(x,0) failed for %s, i = %d\n", - mpfr_print_rnd_mode ((mp_rnd_t) r), i); + mpfr_print_rnd_mode ((mpfr_rnd_t) r), i); exit (1); } } diff --git a/tests/tset_ld.c b/tests/tset_ld.c index 969e85992..a70a9d0d7 100644 --- a/tests/tset_ld.c +++ b/tests/tset_ld.c @@ -70,7 +70,7 @@ check_set_get (long double d, mpfr_t x) for (r = 0; r < MPFR_RND_MAX; r++) { - inex = mpfr_set_ld (x, d, (mp_rnd_t) r); + inex = mpfr_set_ld (x, d, (mpfr_rnd_t) r); if (inex != 0) { printf ("Error: mpfr_set_ld should be exact\n"); @@ -79,7 +79,7 @@ check_set_get (long double d, mpfr_t x) mpfr_dump (x); exit (1); } - e = mpfr_get_ld (x, (mp_rnd_t) r); + e = mpfr_get_ld (x, (mpfr_rnd_t) r); if ((Isnan_ld(d) && ! Isnan_ld(e)) || (Isnan_ld(e) && ! Isnan_ld(d)) || (e != d && !(Isnan_ld(e) && Isnan_ld(d)))) diff --git a/tests/tset_q.c b/tests/tset_q.c index 3c873ad53..5843e8f73 100644 --- a/tests/tset_q.c +++ b/tests/tset_q.c @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-test.h" static void -check (long int n, long int d, mp_rnd_t rnd, const char *ys) +check (long int n, long int d, mpfr_rnd_t rnd, const char *ys) { mpq_t q; mpfr_t x, t; @@ -83,11 +83,11 @@ static void check0(void) mpq_set_si (y, 0, 1); for (r = 0; r < MPFR_RND_MAX; r++) { - inexact = mpfr_set_q(x, y, (mp_rnd_t) r); + inexact = mpfr_set_q(x, y, (mpfr_rnd_t) r); if (!MPFR_IS_ZERO(x) || !MPFR_IS_POS(x) || inexact) { printf("mpfr_set_q(x,0) failed for %s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit(1); } } diff --git a/tests/tset_si.c b/tests/tset_si.c index 1bb5a7294..e3d2d53a6 100644 --- a/tests/tset_si.c +++ b/tests/tset_si.c @@ -103,7 +103,7 @@ test_macros (void) mpfr_inits (x[0], x[1], x[2], (mpfr_ptr) 0); p = x[0]; r = 0; - mpfr_set_ui (p++, 0, (mp_rnd_t) r++); + mpfr_set_ui (p++, 0, (mpfr_rnd_t) r++); if (p != x[1] || r != 1) { printf ("Error in mpfr_set_ui macro: p - x[0] = %d (expecting 1), " @@ -112,7 +112,7 @@ test_macros (void) } p = x[0]; r = 0; - mpfr_set_si (p++, 0, (mp_rnd_t) r++); + mpfr_set_si (p++, 0, (mpfr_rnd_t) r++); if (p != x[1] || r != 1) { printf ("Error in mpfr_set_si macro: p - x[0] = %d (expecting 1), " @@ -230,21 +230,21 @@ main (int argc, char *argv[]) for (r = 0 ; r < MPFR_RND_MAX ; r++) { - mpfr_set_si (x, -1, (mp_rnd_t) r); - mpfr_set_ui (x, 0, (mp_rnd_t) r); - if (MPFR_IS_NEG (x) || mpfr_get_ui (x, (mp_rnd_t) r) != 0) + mpfr_set_si (x, -1, (mpfr_rnd_t) r); + mpfr_set_ui (x, 0, (mpfr_rnd_t) r); + if (MPFR_IS_NEG (x) || mpfr_get_ui (x, (mpfr_rnd_t) r) != 0) { printf ("mpfr_set_ui (x, 0) gives -0 for %s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } - mpfr_set_si (x, -1, (mp_rnd_t) r); - mpfr_set_si (x, 0, (mp_rnd_t) r); - if (MPFR_IS_NEG (x) || mpfr_get_si (x, (mp_rnd_t) r) != 0) + mpfr_set_si (x, -1, (mpfr_rnd_t) r); + mpfr_set_si (x, 0, (mpfr_rnd_t) r); + if (MPFR_IS_NEG (x) || mpfr_get_si (x, (mpfr_rnd_t) r) != 0) { printf ("mpfr_set_si (x, 0) gives -0 for %s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit (1); } } diff --git a/tests/tset_str.c b/tests/tset_str.c index f5c2d1883..5d16d827f 100644 --- a/tests/tset_str.c +++ b/tests/tset_str.c @@ -216,7 +216,7 @@ main (int argc, char *argv[]) mpfr_set_prec (y, prec); for (i=0;i<N;i++) { - mp_rnd_t rnd; + mpfr_rnd_t rnd; mpfr_urandomb (x, RANDS); rnd = RND_RAND (); @@ -755,7 +755,7 @@ main (int argc, char *argv[]) size_t nb_digit = mp_bits_per_limb; mp_limb_t check_limb[2] = {MPFR_LIMB_HIGHBIT, ~(MPFR_LIMB_HIGHBIT >> 1)}; int base[3] = {10, 16, 19}; - mp_rnd_t rnd[3] = {MPFR_RNDU, MPFR_RNDN, MPFR_RNDD}; + mpfr_rnd_t rnd[3] = {MPFR_RNDU, MPFR_RNDN, MPFR_RNDD}; int cbase, climb, crnd; char *str; diff --git a/tests/tset_z.c b/tests/tset_z.c index f46387eda..b1fec04f4 100644 --- a/tests/tset_z.c +++ b/tests/tset_z.c @@ -38,11 +38,11 @@ static void check0(void) mpz_set_si (y, 0); for(r = 0; r < MPFR_RND_MAX; r++) { - inexact = mpfr_set_z (x, y, (mp_rnd_t) r); + inexact = mpfr_set_z (x, y, (mpfr_rnd_t) r); if (!MPFR_IS_ZERO(x) || !MPFR_IS_POS(x) || inexact) { printf("mpfr_set_z(x,0) failed for %s\n", - mpfr_print_rnd_mode ((mp_rnd_t) r)); + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); exit(1); } } @@ -55,7 +55,7 @@ static void check0(void) mpfr_get_si is a rather indirect test of a low level routine. */ static void -check (long i, mp_rnd_t rnd) +check (long i, mpfr_rnd_t rnd) { mpfr_t f; mpz_t z; diff --git a/tests/tsin.c b/tests/tsin.c index 86ec8dfd1..cebe423b3 100644 --- a/tests/tsin.c +++ b/tests/tsin.c @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_sin (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +test_sin (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_get_prec (a)>=53; @@ -48,7 +48,7 @@ test_sin (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) #endif static void -check53 (const char *xs, const char *sin_xs, mp_rnd_t rnd_mode) +check53 (const char *xs, const char *sin_xs, mpfr_rnd_t rnd_mode) { mpfr_t xx, s; @@ -70,7 +70,7 @@ check53 (const char *xs, const char *sin_xs, mp_rnd_t rnd_mode) } static void -check53b (const char *xs, const char *sin_xs, mp_rnd_t rnd_mode) +check53b (const char *xs, const char *sin_xs, mpfr_rnd_t rnd_mode) { mpfr_t xx, s; diff --git a/tests/tsin_cos.c b/tests/tsin_cos.c index b44ab8e32..dfbfa6ced 100644 --- a/tests/tsin_cos.c +++ b/tests/tsin_cos.c @@ -46,7 +46,7 @@ large_test (int prec, int N) static void check53 (const char *xs, const char *sin_xs, const char *cos_xs, - mp_rnd_t rnd_mode) + mpfr_rnd_t rnd_mode) { mpfr_t xx, s, c; @@ -75,7 +75,7 @@ check53 (const char *xs, const char *sin_xs, const char *cos_xs, } static void -check53sin (const char *xs, const char *sin_xs, mp_rnd_t rnd_mode) +check53sin (const char *xs, const char *sin_xs, mpfr_rnd_t rnd_mode) { mpfr_t xx, s, c; @@ -95,7 +95,7 @@ check53sin (const char *xs, const char *sin_xs, mp_rnd_t rnd_mode) } static void -check53cos (const char *xs, const char *cos_xs, mp_rnd_t rnd_mode) +check53cos (const char *xs, const char *cos_xs, mpfr_rnd_t rnd_mode) { mpfr_t xx, c, s; @@ -189,18 +189,18 @@ overflowed_sin_cos0 (void) mpfr_set_si (x, 0, MPFR_RNDN); mpfr_neg (x, x, MPFR_RNDN); mpfr_clear_flags (); - inex = mpfr_sin_cos (x, y, x, (mp_rnd_t) rnd); + inex = mpfr_sin_cos (x, y, x, (mpfr_rnd_t) rnd); if (! mpfr_overflow_p ()) { printf ("Error in overflowed_sin_cos0 (rnd = %s):\n" " The overflow flag is not set.\n", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! (mpfr_zero_p (x) && MPFR_SIGN (x) < 0)) { printf ("Error in overflowed_sin_cos0 (rnd = %s):\n" - " Got sin = ", mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + " Got sin = ", mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (x); printf (" instead of -0.\n"); err = 1; @@ -211,14 +211,14 @@ overflowed_sin_cos0 (void) { printf ("Error in overflowed_sin_cos0 (rnd = %s):\n" " The inexact value must be non-zero.\n", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! mpfr_equal_p (y, z)) { printf ("Error in overflowed_sin_cos0 (rnd = %s):\n" " Got cos = ", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (y); printf (" instead of 0.11111111E%d.\n", emax); err = 1; @@ -230,14 +230,14 @@ overflowed_sin_cos0 (void) { printf ("Error in overflowed_sin_cos0 (rnd = %s):\n" " The inexact value must be non-zero.\n", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); err = 1; } if (! (mpfr_inf_p (y) && MPFR_SIGN (y) > 0)) { printf ("Error in overflowed_sin_cos0 (rnd = %s):\n" " Got cos = ", - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); mpfr_print_binary (y); printf (" instead of +Inf.\n"); err = 1; diff --git a/tests/tsinh_cosh.c b/tests/tsinh_cosh.c index edbc86c4a..347c494c7 100644 --- a/tests/tsinh_cosh.c +++ b/tests/tsinh_cosh.c @@ -48,7 +48,7 @@ failed (mpfr_t x, mpfr_t esh, mpfr_t gsh, mpfr_t ech, mpfr_t gch) /* check against sinh, cosh */ static void -check (mpfr_t x, mp_rnd_t rnd) +check (mpfr_t x, mpfr_rnd_t rnd) { mpfr_t s, c, sx, cx; int isc, is, ic; diff --git a/tests/tsprintf.c b/tests/tsprintf.c index 05ee34494..cf556971d 100644 --- a/tests/tsprintf.c +++ b/tests/tsprintf.c @@ -638,7 +638,7 @@ mixed (void) mpq_t mpq; mpz_t mpz; mpfr_t x; - mp_rnd_t rnd; + mpfr_rnd_t rnd; mpf_init (mpf); mpf_set_ui (mpf, 40); diff --git a/tests/tsqr.c b/tests/tsqr.c index 15f153d01..025c434d1 100644 --- a/tests/tsqr.c +++ b/tests/tsqr.c @@ -35,7 +35,7 @@ inexact_sign (int x) } static void -error1 (mp_rnd_t rnd, mpfr_prec_t prec, +error1 (mpfr_rnd_t rnd, mpfr_prec_t prec, mpfr_t in, mpfr_t outmul, mpfr_t outsqr) { printf("ERROR: for %s and prec=%lu\nINPUT=", mpfr_print_rnd_mode(rnd), prec); @@ -46,7 +46,7 @@ error1 (mp_rnd_t rnd, mpfr_prec_t prec, } static void -error2 (mp_rnd_t rnd, mpfr_prec_t prec, mpfr_t in, mpfr_t out, +error2 (mpfr_rnd_t rnd, mpfr_prec_t prec, mpfr_t in, mpfr_t out, int inexactmul, int inexactsqr) { printf("ERROR: for %s and prec=%lu\nINPUT=", mpfr_print_rnd_mode(rnd), prec); @@ -70,12 +70,12 @@ check_random (mpfr_prec_t p) if (MPFR_IS_PURE_FP(x)) for (r = 0 ; r < MPFR_RND_MAX ; r++) { - inexact1 = mpfr_mul (y, x, x, (mp_rnd_t) r); - inexact2 = mpfr_sqr (z, x, (mp_rnd_t) r); + inexact1 = mpfr_mul (y, x, x, (mpfr_rnd_t) r); + inexact2 = mpfr_sqr (z, x, (mpfr_rnd_t) r); if (mpfr_cmp (y, z)) - error1 ((mp_rnd_t) r,p,x,y,z); + error1 ((mpfr_rnd_t) r,p,x,y,z); if (inexact_sign (inexact1) != inexact_sign (inexact2)) - error2 ((mp_rnd_t) r,p,x,y,inexact1,inexact2); + error2 ((mpfr_rnd_t) r,p,x,y,inexact1,inexact2); } } mpfr_clears (x, y, z, (mpfr_ptr) 0); diff --git a/tests/tsqrt.c b/tests/tsqrt.c index 3c0823b19..5ad7836e7 100644 --- a/tests/tsqrt.c +++ b/tests/tsqrt.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_sqrt (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) +test_sqrt (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b); @@ -49,7 +49,7 @@ test_sqrt (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode) #endif static void -check3 (const char *as, mp_rnd_t rnd_mode, const char *qs) +check3 (const char *as, mpfr_rnd_t rnd_mode, const char *qs) { mpfr_t q; @@ -69,7 +69,7 @@ check3 (const char *as, mp_rnd_t rnd_mode, const char *qs) } static void -check4 (const char *as, mp_rnd_t rnd_mode, const char *Qs) +check4 (const char *as, mpfr_rnd_t rnd_mode, const char *Qs) { mpfr_t q; @@ -90,7 +90,7 @@ check4 (const char *as, mp_rnd_t rnd_mode, const char *Qs) } static void -check24 (const char *as, mp_rnd_t rnd_mode, const char *qs) +check24 (const char *as, mpfr_rnd_t rnd_mode, const char *qs) { mpfr_t q; @@ -422,7 +422,7 @@ static void check_inexact (mp_prec_t p) { mpfr_t x, y, z; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact, sign; mpfr_init2 (x, p); @@ -498,7 +498,7 @@ check_nan (void) /* check that -1 <= x/sqrt(x^2+y^2) <= 1 for rounding to nearest or up */ static void -test_property1 (mp_prec_t p, mp_rnd_t r) +test_property1 (mp_prec_t p, mpfr_rnd_t r) { mpfr_t x, y, z, t; @@ -532,7 +532,7 @@ test_property1 (mp_prec_t p, mp_rnd_t r) /* check sqrt(x^2) = x */ static void -test_property2 (mp_prec_t p, mp_rnd_t r) +test_property2 (mp_prec_t p, mpfr_rnd_t r) { mpfr_t x, y; diff --git a/tests/tsqrt_ui.c b/tests/tsqrt_ui.c index 6eac24594..a59dfed94 100644 --- a/tests/tsqrt_ui.c +++ b/tests/tsqrt_ui.c @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-test.h" static void -check (unsigned long a, mp_rnd_t rnd_mode, const char *qs) +check (unsigned long a, mpfr_rnd_t rnd_mode, const char *qs) { mpfr_t q; diff --git a/tests/tsub.c b/tests/tsub.c index 190a0f6b6..f0fe03729 100644 --- a/tests/tsub.c +++ b/tests/tsub.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef CHECK_EXTERNAL static int -test_sub (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) +test_sub (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_number_p (c); @@ -354,7 +354,7 @@ static void check_two_sum (mp_prec_t p) { mpfr_t x, y, u, v, w; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact; mpfr_init2 (x, p); @@ -400,7 +400,7 @@ check_inexact (void) mpfr_t x, y, z, u; mp_prec_t px, py, pu, pz; int inexact, cmp; - mp_rnd_t rnd; + mpfr_rnd_t rnd; mpfr_init (x); mpfr_init (y); diff --git a/tests/tsub1sp.c b/tests/tsub1sp.c index 2e0782e1f..8c624d823 100644 --- a/tests/tsub1sp.c +++ b/tests/tsub1sp.c @@ -46,7 +46,7 @@ main (void) #define STD_ERROR \ {\ printf("ERROR: for %s and p=%lu and i=%d:\nY=",\ - mpfr_print_rnd_mode ((mp_rnd_t) r), p, i);\ + mpfr_print_rnd_mode ((mpfr_rnd_t) r), p, i);\ mpfr_print_binary(y);\ printf("\nZ="); mpfr_print_binary(z);\ printf("\nReal: "); mpfr_print_binary(x2);\ @@ -58,7 +58,7 @@ main (void) #define STD_ERROR2 \ {\ printf("ERROR: for %s and p=%lu and i=%d:\nY=",\ - mpfr_print_rnd_mode ((mp_rnd_t) r), p, i);\ + mpfr_print_rnd_mode ((mpfr_rnd_t) r), p, i);\ mpfr_print_binary(y);\ printf("\nZ="); mpfr_print_binary(z);\ printf("\nR="); mpfr_print_binary(x);\ @@ -83,8 +83,8 @@ check_random (mpfr_prec_t p) if (MPFR_IS_PURE_FP(y) && MPFR_IS_PURE_FP(z)) for(r = 0 ; r < MPFR_RND_MAX ; r++) { - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -117,7 +117,7 @@ check_special (void) mpfr_set_str_binary (y, "0.10110111101101110010010010011011000001101101011011001E31"); - mpfr_sub1sp (x, y, y, (mp_rnd_t) r); + mpfr_sub1sp (x, y, y, (mpfr_rnd_t) r); if (mpfr_cmp_ui(x, 0)) { printf("Error for x-x with p=%lu. Expected 0. Got:", p); @@ -125,8 +125,8 @@ check_special (void) exit(1); } - mpfr_set(z, y, (mp_rnd_t) r); - mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + mpfr_set(z, y, (mpfr_rnd_t) r); + mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp_ui(x, 0)) { printf("Error for x-y with y=x and p=%lu. Expected 0. Got:", p); @@ -136,8 +136,8 @@ check_special (void) /* diff = 0 */ mpfr_set_str_binary (y, "0.10110111101101110010010010011011001001101101011011001E31"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -146,8 +146,8 @@ check_special (void) /* Diff = 1 */ mpfr_set_str_binary (y, "0.10110111101101110010010010011011000001101101011011001E30"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -156,8 +156,8 @@ check_special (void) /* Diff = 2 */ mpfr_set_str_binary (y, "0.10110111101101110010010010011011000101101101011011001E32"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -166,8 +166,8 @@ check_special (void) /* Diff = 32 */ mpfr_set_str_binary (y, "0.10110111101101110010010010011011000001101101011011001E63"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -176,8 +176,8 @@ check_special (void) /* Diff = 52 */ mpfr_set_str_binary (y, "0.10110111101101110010010010011011010001101101011011001E83"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -186,8 +186,8 @@ check_special (void) /* Diff = 53 */ mpfr_set_str_binary (y, "0.10110111101101110010010010011111000001101101011011001E31"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -196,8 +196,8 @@ check_special (void) /* Diff > 200 */ mpfr_set_str_binary (y, "0.10110111101101110010010010011011000001101101011011001E331"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -207,8 +207,8 @@ check_special (void) "0.10000000000000000000000000000000000000000000000000000E31"); mpfr_set_str_binary (z, "0.11111111111111111111111111111111111111111111111111111E30"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -218,8 +218,8 @@ check_special (void) "0.10000000000000000000000000000000000000000000000000000E31"); mpfr_set_str_binary (z, "0.11111111111111111111111111111111111111111111111111111E29"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -229,8 +229,8 @@ check_special (void) "0.10000000000000000000000000000000000000000000000000000E52"); mpfr_set_str_binary (z, "0.10000000000010000000000000000000000000000000000000000E00"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -240,9 +240,9 @@ check_special (void) "0.11100000000000000000000000000000000000000000000000000E53"); mpfr_set_str_binary (z, "0.10000000000000000000000000000000000000000000000000000E00"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(z, y, z, (mp_rnd_t) r); - mpfr_set(x, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(z, y, z, (mpfr_rnd_t) r); + mpfr_set(x, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -252,8 +252,8 @@ check_special (void) "0.10000000000000000000000000000000000000000000000000000E53"); mpfr_set_str_binary (z, "0.10100000000000000000000000000000000000000000000000000E00"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -263,8 +263,8 @@ check_special (void) "0.10000000000000000000000000000000000000000000000000000E54"); mpfr_set_str_binary (z, "0.10100000000000000000000000000000000000000000000000000E00"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -279,8 +279,8 @@ check_special (void) "0.100000000000000000000000000000000000000000000000000000000000000E62"); mpfr_set_str_binary (z, "0.110000000000000000000000000000000000000000000000000000000000000E00"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -296,8 +296,8 @@ check_special (void) "0.1100000000000000000000000000000000000000000000000000000000000000E31"); mpfr_set_str_binary (z, "0.1111111111111111111111111110000000000000000000000000011111111111E29"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -307,8 +307,8 @@ check_special (void) "0.1000000000000000000000000000000000000000000000000000000000000000E63"); mpfr_set_str_binary (z, "0.1011000000000000000000000000000000000000000000000000000000000000E00"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -318,8 +318,8 @@ check_special (void) "0.1000000000000000000000000000000000000000000000000000000000000000E63"); mpfr_set_str_binary (z, "0.1110000000000000000000000000000000000000000000000000000000000000E00"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -329,8 +329,8 @@ check_special (void) "0.10000000000000000000000000000000000000000000000000000000000000E63"); mpfr_set_str_binary (z, "0.10000000000000000000000000000000000000000000000000000000000000E00"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -340,8 +340,8 @@ check_special (void) "0.1000000000000000000000000000000000000000000000000000000000000000E64"); mpfr_set_str_binary (z, "0.1010000000000000000000000000000000000000000000000000000000000000E00"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -355,8 +355,8 @@ check_special (void) mpfr_set_str_binary (z, "0.1100000000000000000000000000000000000000000000000000000000000000" "E-1073741823"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -370,8 +370,8 @@ check_special (void) mpfr_set_str_binary (y, "0.100000000E1"); mpfr_set_str_binary (z, "0.100000000E-8"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -385,8 +385,8 @@ check_special (void) mpfr_set_str_binary (y, "-0.1011110000111100010111011100110100E-18"); mpfr_set_str_binary (z, "0.1000101010110011010101011110000000E-14"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -402,8 +402,8 @@ check_special (void) "0.1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E1"); mpfr_set_str_binary (z, "0.1011111000100111000011001000011101010101101100101010101001000001110100001101110110001110111010000011101001100010111110001100E-31"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -419,8 +419,8 @@ check_special (void) "0.111000110011000001000111101010111011110011101001101111111110000011100101000001001010110010101010011001010100000001110011110001010101101010001011101110100100001011110100110000101101100011010001001011011010101010000010001101001000110010010111111011110001111101001000101101001100101100101000E80"); mpfr_set_str_binary (z, "-0.100001111111101001011010001100110010100111001110000110011101001011010100001000000100111011010110110010000000000010101101011000010000110001110010100001100101011100100100001011000100011110000001010101000100011101001000010111100000111000111011001000100100011000100000010010111000000100100111E-258"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -436,8 +436,8 @@ check_special (void) "0.1111101110100110110110100010101011101001100010100011110110110010010011101100101111100E-4"); mpfr_set_str_binary (z, "0.1111101110100110110110100010101001001000011000111000011101100101110100001110101010110E-4"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -453,8 +453,8 @@ check_special (void) mpfr_set_str_binary (z, "0.10000000000000000000000000000000" "00000000000000000000000000000001E0"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -466,8 +466,8 @@ check_special (void) mpfr_set_str_binary (z, "0.10000000000000000000000000000000" "00000000000000000000000000000001E0"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -482,8 +482,8 @@ check_special (void) mpfr_set_str_binary (z, "0.10000000000000000000000000000000" "00000000000000000000000000000001E-1023"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) @@ -495,8 +495,8 @@ check_special (void) mpfr_set_str_binary (z, "0.1000000000000000000000000000000" "000000000000000000000000000000E-1023"); - inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r); - inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r); + inexact1 = mpfr_sub1(x2, y, z, (mpfr_rnd_t) r); + inexact2 = mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r); if (mpfr_cmp(x, x2)) STD_ERROR; if (inexact1 != inexact2) diff --git a/tests/tsub_ui.c b/tests/tsub_ui.c index 6bcdc1978..c51224c03 100644 --- a/tests/tsub_ui.c +++ b/tests/tsub_ui.c @@ -28,7 +28,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* checks that x-y gives the right results with 53 bits of precision */ static void -check3 (const char *xs, unsigned long y, mp_rnd_t rnd_mode, const char *zs) +check3 (const char *xs, unsigned long y, mpfr_rnd_t rnd_mode, const char *zs) { mpfr_t xx,zz; @@ -54,7 +54,7 @@ check_two_sum (mp_prec_t p) { unsigned int x; mpfr_t y, u, v, w; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact; mpfr_inits2 (p, y, u, v, w, (mpfr_ptr) 0); diff --git a/tests/tsubnormal.c b/tests/tsubnormal.c index af3aac550..3b2f7e4fc 100644 --- a/tests/tsubnormal.c +++ b/tests/tsubnormal.c @@ -29,7 +29,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static const struct { const char *in; int i; - mp_rnd_t rnd; + mpfr_rnd_t rnd; const char *out; } tab[] ={ {"1E1", 0, MPFR_RNDN, "1E1"}, diff --git a/tests/tsum.c b/tests/tsum.c index 81afc0258..5e45821cf 100644 --- a/tests/tsum.c +++ b/tests/tsum.c @@ -36,7 +36,7 @@ check_is_sorted (unsigned long n, mpfr_srcptr *perm) } static int -sum_tab (mpfr_ptr ret, mpfr_t *tab, unsigned long n, mp_rnd_t rnd) +sum_tab (mpfr_ptr ret, mpfr_t *tab, unsigned long n, mpfr_rnd_t rnd) { mpfr_ptr *tabtmp; unsigned long i; @@ -159,8 +159,8 @@ test_sum (mp_prec_t f, unsigned long n) algo_exact (real_non_rounded, tab, n, f); for (rnd_mode = 0; rnd_mode < MPFR_RND_MAX; rnd_mode++) { - sum_tab (sum, tab, n, (mp_rnd_t) rnd_mode); - mpfr_set (real_sum, real_non_rounded, (mp_rnd_t) rnd_mode); + sum_tab (sum, tab, n, (mpfr_rnd_t) rnd_mode); + mpfr_set (real_sum, real_non_rounded, (mpfr_rnd_t) rnd_mode); if (mpfr_cmp (real_sum, sum) != 0) { printf ("mpfr_sum incorrect.\n"); @@ -179,8 +179,8 @@ test_sum (mp_prec_t f, unsigned long n) algo_exact (real_non_rounded, tab, n, f); for (rnd_mode = 0; rnd_mode < MPFR_RND_MAX; rnd_mode++) { - sum_tab (sum, tab, n, (mp_rnd_t) rnd_mode); - mpfr_set (real_sum, real_non_rounded, (mp_rnd_t) rnd_mode); + sum_tab (sum, tab, n, (mpfr_rnd_t) rnd_mode); + mpfr_set (real_sum, real_non_rounded, (mpfr_rnd_t) rnd_mode); if (mpfr_cmp (real_sum, sum) != 0) { printf ("mpfr_sum incorrect.\n"); diff --git a/tests/tui_div.c b/tests/tui_div.c index 30f1ac31b..11970fcc0 100644 --- a/tests/tui_div.c +++ b/tests/tui_div.c @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* checks that y/x gives the right result with 53 bits of precision */ static void -check (unsigned long y, const char *xs, mp_rnd_t rnd_mode, const char *zs) +check (unsigned long y, const char *xs, mpfr_rnd_t rnd_mode, const char *zs) { mpfr_t xx, zz; @@ -73,8 +73,8 @@ check_inexact (void) mpfr_set_prec (z, py + px); for (rnd = 0; rnd < MPFR_RND_MAX; rnd++) { - inexact = mpfr_ui_div (y, u, x, (mp_rnd_t) rnd); - if (mpfr_mul (z, y, x, (mp_rnd_t) rnd)) + inexact = mpfr_ui_div (y, u, x, (mpfr_rnd_t) rnd); + if (mpfr_mul (z, y, x, (mpfr_rnd_t) rnd)) { printf ("z <- y * x should be exact\n"); exit (1); @@ -85,7 +85,7 @@ check_inexact (void) ((inexact < 0) && (cmp >= 0))) { printf ("Wrong inexact flag for u=%lu, rnd=%s\n", - u, mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + u, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf ("expected %d, got %d\n", cmp, inexact); printf ("x="); mpfr_print_binary (x); puts (""); printf ("y="); mpfr_print_binary (y); puts (""); @@ -159,7 +159,7 @@ check_nan (void) } static int -mpfr_inv (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t r) +mpfr_inv (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t r) { return mpfr_ui_div (y, 1, x, r); } diff --git a/tests/tui_pow.c b/tests/tui_pow.c index a15a1b254..b198d2639 100644 --- a/tests/tui_pow.c +++ b/tests/tui_pow.c @@ -84,7 +84,7 @@ test1 (void) } static void -check1 (mpfr_ptr x, mp_prec_t prec, unsigned long nt, mp_rnd_t rnd) +check1 (mpfr_ptr x, mp_prec_t prec, unsigned long nt, mpfr_rnd_t rnd) { mpfr_t y, z, t; int inexact, compare, compare2; @@ -191,7 +191,7 @@ main (int argc, char *argv[]) { mpfr_t z, t; mp_prec_t prec; - mp_rnd_t rnd; + mpfr_rnd_t rnd; unsigned int n; mp_prec_t p0=2, p1=100; diff --git a/tests/tui_sub.c b/tests/tui_sub.c index 4c75261cc..facf0c181 100644 --- a/tests/tui_sub.c +++ b/tests/tui_sub.c @@ -142,7 +142,7 @@ special (void) /* checks that (y-x) gives the right results with 53 bits of precision */ static void -check (unsigned long y, const char *xs, mp_rnd_t rnd_mode, const char *zs) +check (unsigned long y, const char *xs, mpfr_rnd_t rnd_mode, const char *zs) { mpfr_t xx, zz; @@ -166,7 +166,7 @@ check_two_sum (mp_prec_t p) { unsigned int x; mpfr_t y, u, v, w; - mp_rnd_t rnd; + mpfr_rnd_t rnd; int inexact; mpfr_inits2 (p, y, u, v, w, (mpfr_ptr) 0); @@ -247,8 +247,8 @@ static void check_neg (void) { int tneg, tsub; - tneg = mpfr_neg (yneg, x, (mp_rnd_t) r); - tsub = mpfr_ui_sub (ysub, 0, x, (mp_rnd_t) r); + tneg = mpfr_neg (yneg, x, (mpfr_rnd_t) r); + tsub = mpfr_ui_sub (ysub, 0, x, (mpfr_rnd_t) r); MPFR_ASSERTN (mpfr_equal_p (yneg, ysub)); MPFR_ASSERTN (!(MPFR_IS_POS (yneg) ^ MPFR_IS_POS (ysub))); MPFR_ASSERTN (tneg == tsub); diff --git a/tests/tzeta.c b/tests/tzeta.c index 335f32aa8..266d9062a 100644 --- a/tests/tzeta.c +++ b/tests/tzeta.c @@ -200,7 +200,7 @@ main (int argc, char *argv[]) { mpfr_t s, y, z; mp_prec_t prec; - mp_rnd_t rnd_mode; + mpfr_rnd_t rnd_mode; int inex; tests_start_mpfr (); @@ -218,7 +218,7 @@ main (int argc, char *argv[]) mpfr_init2 (s, prec); mpfr_init2 (z, prec); mpfr_set_str (s, argv[1], 10, MPFR_RNDN); - rnd_mode = (mp_rnd_t) atoi(argv[3]); + rnd_mode = (mpfr_rnd_t) atoi(argv[3]); mpfr_zeta (z, s, rnd_mode); mpfr_out_str (stdout, 10, 0, z, MPFR_RNDN); diff --git a/tests/tzeta_ui.c b/tests/tzeta_ui.c index 9718dec2c..6aab54111 100644 --- a/tests/tzeta_ui.c +++ b/tests/tzeta_ui.c @@ -48,7 +48,7 @@ main (int argc, char *argv[]) { mpfr_set_prec (x, atoi (argv[2])); mpfr_zeta_ui (x, atoi (argv[1]), - argc > 3 ? (mp_rnd_t) atoi (argv[3]) : MPFR_RNDN); + argc > 3 ? (mpfr_rnd_t) atoi (argv[3]) : MPFR_RNDN); mpfr_out_str (stdout, 10, 0, x, MPFR_RNDN); printf ("\n"); goto clear_and_exit; @@ -81,13 +81,13 @@ main (int argc, char *argv[]) if (mpfr_can_round (y, yprec, MPFR_RNDN, MPFR_RNDZ, prec + (rnd == MPFR_RNDN))) { - mpfr_set (t, y, (mp_rnd_t) rnd); - inexact = mpfr_zeta_ui (z, n, (mp_rnd_t) rnd); + mpfr_set (t, y, (mpfr_rnd_t) rnd); + inexact = mpfr_zeta_ui (z, n, (mpfr_rnd_t) rnd); if (mpfr_cmp (t, z)) { printf ("results differ for n=%lu", n); printf (" prec=%u rnd_mode=%s\n", prec, - mpfr_print_rnd_mode ((mp_rnd_t) rnd)); + mpfr_print_rnd_mode ((mpfr_rnd_t) rnd)); printf (" got "); mpfr_dump (z); printf (" expected "); @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_ui_div (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_ui_div (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t uu; mp_limb_t up[1]; @@ -81,7 +81,7 @@ mpfr_ui_div (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mp_rnd_t rnd_mode) } -int mpfr_si_div (mpfr_ptr y, long int u, mpfr_srcptr x,mp_rnd_t rnd_mode) +int mpfr_si_div (mpfr_ptr y, long int u, mpfr_srcptr x,mpfr_rnd_t rnd_mode) { int res; @@ -23,7 +23,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_ui_pow (mpfr_ptr y, unsigned long int n, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_ui_pow (mpfr_ptr y, unsigned long int n, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t t; int inexact; diff --git a/ui_pow_ui.c b/ui_pow_ui.c index 8c8b5f4ab..8e55ab68c 100644 --- a/ui_pow_ui.c +++ b/ui_pow_ui.c @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., int mpfr_ui_pow_ui (mpfr_ptr x, unsigned long int y, unsigned long int n, - mp_rnd_t rnd) + mpfr_rnd_t rnd) { mp_exp_t err; unsigned long m; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_ui_sub (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mp_rnd_t rnd_mode) +mpfr_ui_sub (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mpfr_rnd_t rnd_mode) { mpfr_t uu; mp_limb_t up[1]; diff --git a/vasprintf.c b/vasprintf.c index 948af6217..ed3d251d4 100644 --- a/vasprintf.c +++ b/vasprintf.c @@ -174,7 +174,7 @@ struct printf_spec int prec; /* Precision */ enum arg_t arg_type; /* Type of argument */ - mp_rnd_t rnd_mode; /* Rounding mode */ + mpfr_rnd_t rnd_mode; /* Rounding mode */ char spec; /* Conversion specifier */ char pad; /* Padding character */ @@ -24,16 +24,16 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define MPFR_NEED_LONGLONG_H #include "mpfr-impl.h" -static int mpfr_yn_asympt (mpfr_ptr, long, mpfr_srcptr, mp_rnd_t); +static int mpfr_yn_asympt (mpfr_ptr, long, mpfr_srcptr, mpfr_rnd_t); int -mpfr_y0 (mpfr_ptr res, mpfr_srcptr z, mp_rnd_t r) +mpfr_y0 (mpfr_ptr res, mpfr_srcptr z, mpfr_rnd_t r) { return mpfr_yn (res, 0, z, r); } int -mpfr_y1 (mpfr_ptr res, mpfr_srcptr z, mp_rnd_t r) +mpfr_y1 (mpfr_ptr res, mpfr_srcptr z, mpfr_rnd_t r) { return mpfr_yn (res, 1, z, r); } @@ -147,7 +147,7 @@ mpfr_yn_s3 (mpfr_ptr s, mpfr_srcptr y, mpfr_srcptr c, unsigned long n) } int -mpfr_yn (mpfr_ptr res, long n, mpfr_srcptr z, mp_rnd_t r) +mpfr_yn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r) { int inex; unsigned long absn; @@ -139,7 +139,7 @@ mpfr_zeta_part_a (mpfr_t sum, mpfr_srcptr s, int n) Output: z - Zeta(s) rounded to the precision of z with direction rnd_mode */ static int -mpfr_zeta_pos (mpfr_t z, mpfr_srcptr s, mp_rnd_t rnd_mode) +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; @@ -295,7 +295,7 @@ mpfr_zeta_pos (mpfr_t z, mpfr_srcptr s, mp_rnd_t rnd_mode) } int -mpfr_zeta (mpfr_t z, mpfr_srcptr s, mp_rnd_t rnd_mode) +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; @@ -24,7 +24,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" int -mpfr_zeta_ui (mpfr_ptr z, unsigned long m, mp_rnd_t r) +mpfr_zeta_ui (mpfr_ptr z, unsigned long m, mpfr_rnd_t r) { MPFR_ZIV_DECL (loop); |