summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.dev1
-rw-r--r--doc/mpc.texi14
-rw-r--r--src/acos.c12
-rw-r--r--src/asin.c6
-rw-r--r--src/atan.c6
-rw-r--r--src/cos.c2
-rw-r--r--src/div.c2
-rw-r--r--src/exp.c14
-rw-r--r--src/get_prec.c4
-rw-r--r--src/get_prec2.c2
-rw-r--r--src/get_str.c2
-rw-r--r--src/init2.c2
-rw-r--r--src/init3.c2
-rw-r--r--src/log.c2
-rw-r--r--src/mpc-impl.h4
-rw-r--r--src/mpc.h10
-rw-r--r--src/mul.c8
-rw-r--r--src/norm.c2
-rw-r--r--src/pow.c18
-rw-r--r--src/pow_ui.c6
-rw-r--r--src/set_prec.c2
-rw-r--r--src/sin.c2
-rw-r--r--src/sqr.c2
-rw-r--r--src/sqrt.c4
-rw-r--r--src/tan.c2
-rw-r--r--src/uceil_log2.c2
26 files changed, 67 insertions, 66 deletions
diff --git a/README.dev b/README.dev
index fcf3537..099d36e 100644
--- a/README.dev
+++ b/README.dev
@@ -17,6 +17,7 @@ Creating a new release
0) Run all tests with valgrind and check no memory leak remains:
for f in .libs/lt-t*; do valgrind $f; done
0b) Disable test in line 35 of log.dat.
+ 0c) Check compilation with gmp 4.2.2 and mpfr 2.3.1.
1) Check the version number in configure.ac ("AC_INIT (mpc, _version_...)"),
INSTALL, src/get_version.c, src/mpc.h (remove suffix "-dev" in
MPC_VERSION_STRING) and Makefile.vc.
diff --git a/doc/mpc.texi b/doc/mpc.texi
index 1e65beb..9071318 100644
--- a/doc/mpc.texi
+++ b/doc/mpc.texi
@@ -355,11 +355,11 @@ arbitrary precision floating-point numbers (for the real and imaginary parts).
The C data type for such objects is @code{mpc_t}.
@cindex Precision
-@tindex @code{mp_prec_t}
+@tindex @code{mpfr_prec_t}
@noindent
The @dfn{Precision} is the number of bits used to represent the mantissa
of the real and imaginary parts;
-the corresponding C data type is @code{mp_prec_t}.
+the corresponding C data type is @code{mpfr_prec_t}.
For more details on the allowed precision range,
@ifinfo
@pxref{Nomenclature and Types,,, mpfr.info,MPFR}.
@@ -508,14 +508,14 @@ An @code{mpc_t} object must be initialized before storing the first value in
it. The functions @code{mpc_init2} and @code{mpc_init3}
are used for that purpose.
-@deftypefun void mpc_init2 (mpc_t @var{z}, mp_prec_t @var{prec})
+@deftypefun void mpc_init2 (mpc_t @var{z}, mpfr_prec_t @var{prec})
Initialize @var{z} to precision @var{prec} bits
and set its real and imaginary parts to NaN.
Normally, a variable should be initialized once only
or at least be cleared, using @code{mpc_clear}, between initializations.
@end deftypefun
-@deftypefun void mpc_init3 (mpc_t @var{z}, mp_prec_t @var{prec_r}, mp_prec_t @var{prec_i})
+@deftypefun void mpc_init3 (mpc_t @var{z}, mpfr_prec_t @var{prec_r}, mpfr_prec_t @var{prec_i})
Initialize @var{z} with the precision of its real part being
@var{prec_r} bits and the precision of its imaginary part being
@var{prec_i} bits, and set the real and imaginary parts to NaN.
@@ -544,7 +544,7 @@ calculation. A typical use would be for adjusting the precision gradually in
iterative algorithms like Newton-Raphson, making the computation precision
closely match the actual accurate part of the numbers.
-@deftypefun void mpc_set_prec (mpc_t @var{x}, mp_prec_t @var{prec})
+@deftypefun void mpc_set_prec (mpc_t @var{x}, mpfr_prec_t @var{prec})
Reset the precision of @var{x} to be @strong{exactly} @var{prec} bits,
and set its real/imaginary parts to NaN.
The previous value stored in @var{x} is lost. It is equivalent to
@@ -553,12 +553,12 @@ a call to @code{mpc_clear(x)} followed by a call to
case the current allocated space for the mantissa of @var{x} is sufficient.
@end deftypefun
-@deftypefun mp_prec_t mpc_get_prec (mpc_t @var{x})
+@deftypefun mpfr_prec_t mpc_get_prec (mpc_t @var{x})
If the real and imaginary part of @var{x} have the same precision, it is returned,
otherwise, 0 is returned.
@end deftypefun
-@deftypefun void mpc_get_prec2 (mp_prec_t* @var{pr}, mp_prec_t* @var{pi}, mpc_t @var{x})
+@deftypefun void mpc_get_prec2 (mpfr_prec_t* @var{pr}, mpfr_prec_t* @var{pi}, mpc_t @var{x})
Returns the precision of the real part of @var{x} via @var{pr} and of its imaginary part
via @var{pi}.
@end deftypefun
diff --git a/src/acos.c b/src/acos.c
index 1e6c8fb..cf972dd 100644
--- a/src/acos.c
+++ b/src/acos.c
@@ -28,7 +28,7 @@ int
mpc_acos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
int inex_re, inex_im, inex;
- mp_prec_t p_re, p_im, p;
+ mpfr_prec_t p_re, p_im, p;
mpc_t z1;
mpfr_t pi_over_2;
mp_exp_t e1, e2;
@@ -74,14 +74,14 @@ mpc_acos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
}
else
{
-
+
/* the real part of the result is 3*pi/4
a = o(pi) error(a) < 1 ulp(a)
b = o(3*a) error(b) < 2 ulp(b)
c = b/4 exact
thus 1 bit is lost */
mpfr_t x;
- mp_prec_t prec;
+ mpfr_prec_t prec;
int ok;
mpfr_init (x);
prec = mpfr_get_prec (MPC_RE (rop));
@@ -159,7 +159,7 @@ mpc_acos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
if (!s_im)
mpc_conj (rop, rop, MPC_RNDNN);
- return MPC_INEX (inex_re, inex_im);
+ return MPC_INEX (inex_re, inex_im);
}
/* pure imaginary argument */
@@ -170,7 +170,7 @@ mpc_acos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
INV_RND (MPC_RND_IM (rnd)));
mpc_conj (rop,rop, MPC_RNDNN);
- return MPC_INEX (inex_re, inex_im);
+ return MPC_INEX (inex_re, inex_im);
}
/* regular complex argument: acos(z) = Pi/2 - asin(z) */
@@ -194,7 +194,7 @@ mpc_acos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
for (;;)
{
p += mpc_ceil_log2 (p) + 3;
-
+
mpfr_set_prec (MPC_RE(z1), p);
mpfr_set_prec (pi_over_2, p);
diff --git a/src/asin.c b/src/asin.c
index dfe23dd..7e1afc4 100644
--- a/src/asin.c
+++ b/src/asin.c
@@ -26,7 +26,7 @@ extern int set_pi_over_2 (mpfr_ptr rop, int s, mpfr_rnd_t rnd);
int
mpc_asin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
- mp_prec_t p, p_re, p_im;
+ mpfr_prec_t p, p_re, p_im;
mp_rnd_t rnd_re, rnd_im;
mpc_t z1;
int inex;
@@ -124,7 +124,7 @@ mpc_asin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
inex_re = mpfr_asin (MPC_RE (rop), MPC_RE (op), MPC_RND_RE (rnd));
}
- return MPC_INEX (inex_re, inex_im);
+ return MPC_INEX (inex_re, inex_im);
}
/* pure imaginary argument */
@@ -138,7 +138,7 @@ mpc_asin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
mpfr_neg (MPC_RE (rop), MPC_RE (rop), GMP_RNDN);
inex_im = mpfr_asinh (MPC_IM (rop), MPC_IM (op), MPC_RND_IM (rnd));
- return MPC_INEX (0, inex_im);
+ return MPC_INEX (0, inex_im);
}
/* regular complex: asin(z) = -i*log(i*z+sqrt(1-z^2)) */
diff --git a/src/atan.c b/src/atan.c
index 8f6ab79..bf37036 100644
--- a/src/atan.c
+++ b/src/atan.c
@@ -144,7 +144,7 @@ mpc_atan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
atan(-0+iy) = -pi/2 +i*atanh(1/y), if |y| > 1 */
mp_rnd_t rnd_im, rnd_away;
mpfr_t y;
- mp_prec_t p, p_im;
+ mpfr_prec_t p, p_im;
int ok;
rnd_im = MPC_RND_IM (rnd);
@@ -190,7 +190,7 @@ mpc_atan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
/* regular number argument */
{
mpfr_t a, b, x, y;
- mp_prec_t prec, p;
+ mpfr_prec_t prec, p;
mp_exp_t err, expo;
int ok = 0;
mpfr_t minus_op_re;
@@ -225,7 +225,7 @@ mpc_atan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
*/
/* p: working precision */
- p = (op_im_exp > 0 || prec > SAFE_ABS (mp_prec_t, op_im_exp)) ? prec
+ p = (op_im_exp > 0 || prec > SAFE_ABS (mpfr_prec_t, op_im_exp)) ? prec
: (prec - op_im_exp);
rnd1 = mpfr_sgn (MPC_RE (op)) > 0 ? GMP_RNDD : GMP_RNDU;
rnd2 = mpfr_sgn (MPC_RE (op)) < 0 ? GMP_RNDU : GMP_RNDD;
diff --git a/src/cos.c b/src/cos.c
index a6e9fd0..8ff4d05 100644
--- a/src/cos.c
+++ b/src/cos.c
@@ -25,7 +25,7 @@ int
mpc_cos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
mpfr_t x, y, z;
- mp_prec_t prec;
+ mpfr_prec_t prec;
int ok = 0;
int inex_re, inex_im;
diff --git a/src/div.c b/src/div.c
index 6e86f19..9aa7cf9 100644
--- a/src/div.c
+++ b/src/div.c
@@ -149,7 +149,7 @@ mpc_div (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
int ok_re = 0, ok_im = 0;
mpc_t res, c_conj;
mpfr_t q;
- mp_prec_t prec;
+ mpfr_prec_t prec;
int inexact_prod, inexact_norm, inexact_re, inexact_im, loops = 0;
/* save signs of operands in case there are overlaps */
diff --git a/src/exp.c b/src/exp.c
index ce73368..3ef42b8 100644
--- a/src/exp.c
+++ b/src/exp.c
@@ -25,7 +25,7 @@ int
mpc_exp (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
mpfr_t x, y, z;
- mp_prec_t prec;
+ mpfr_prec_t prec;
int ok = 0;
int inex_re, inex_im;
@@ -44,10 +44,10 @@ mpc_exp (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
<= ulp(r) + 2 * ulp(x*y) + ulp(x*y) [Rule 4]
<= 4 * ulp(r) [Rule 8]
*/
-
+
/* special values */
if (mpfr_nan_p (MPC_RE (op)) || mpfr_nan_p (MPC_IM (op)))
- /* NaNs
+ /* NaNs
exp(nan +i*y) = nan -i*0 if y = -0,
nan +i*0 if y = +0,
nan +i*nan otherwise
@@ -76,7 +76,7 @@ mpc_exp (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
if (mpfr_zero_p (MPC_IM(op)))
- /* special case when the input is real
+ /* special case when the input is real
exp(x-i*0) = exp(x) -i*0, even if x is NaN
exp(x+i*0) = exp(x) +i*0, even if x is NaN */
{
@@ -95,7 +95,7 @@ mpc_exp (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
if (mpfr_inf_p (MPC_RE (op)))
- /* real part is an infinity,
+ /* real part is an infinity,
exp(-inf +i*y) = 0*(cos y +i*sin y)
exp(+inf +i*y) = +/-inf +i*nan if y = +/-inf
+inf*(cos y +i*sin y) if 0 < |y| < inf */
@@ -107,7 +107,7 @@ mpc_exp (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
mpfr_set_ui (n, 0, GMP_RNDN);
else
mpfr_set_inf (n, +1);
-
+
if (mpfr_inf_p (MPC_IM (op)))
{
inex_re = mpfr_set (MPC_RE (rop), n, GMP_RNDN);
@@ -187,6 +187,6 @@ mpc_exp (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
mpfr_clear (x);
mpfr_clear (y);
mpfr_clear (z);
-
+
return MPC_INEX(inex_re, inex_im);
}
diff --git a/src/get_prec.c b/src/get_prec.c
index 7f56e9e..cd206e1 100644
--- a/src/get_prec.c
+++ b/src/get_prec.c
@@ -22,9 +22,9 @@ MA 02111-1307, USA. */
#include "mpc-impl.h"
-mp_prec_t
+mpfr_prec_t
mpc_get_prec (mpc_srcptr x)
{
- mp_prec_t precre = MPFR_PREC (MPC_RE (x));
+ mpfr_prec_t precre = MPFR_PREC (MPC_RE (x));
return (MPFR_PREC (MPC_IM (x)) == precre ? precre : 0);
}
diff --git a/src/get_prec2.c b/src/get_prec2.c
index 1ea86f4..2512c1c 100644
--- a/src/get_prec2.c
+++ b/src/get_prec2.c
@@ -23,7 +23,7 @@ MA 02111-1307, USA. */
#include "mpc-impl.h"
void
-mpc_get_prec2 (mp_prec_t *pr, mp_prec_t *pi, mpc_srcptr x)
+mpc_get_prec2 (mpfr_prec_t *pr, mpfr_prec_t *pi, mpc_srcptr x)
{
*pr = MPFR_PREC (MPC_RE (x));
*pi = MPFR_PREC (MPC_IM (x));
diff --git a/src/get_str.c b/src/get_str.c
index 392435d..183079c 100644
--- a/src/get_str.c
+++ b/src/get_str.c
@@ -32,7 +32,7 @@ MA 02111-1307, USA. */
/* The output format is "(real imag)", the decimal point of the locale is
used. */
-/* mp_prec_t can be either int or long int */
+/* mpfr_prec_t can be either int or long int */
#if (__GMP_MP_SIZE_T_INT == 1)
#define MPC_EXP_FORMAT_SPEC "i"
#elif (__GMP_MP_SIZE_T_INT == 0)
diff --git a/src/init2.c b/src/init2.c
index 841ff7b..15d5861 100644
--- a/src/init2.c
+++ b/src/init2.c
@@ -22,7 +22,7 @@ MA 02111-1307, USA. */
#include "mpc-impl.h"
void
-mpc_init2 (mpc_t x, mp_prec_t prec)
+mpc_init2 (mpc_t x, mpfr_prec_t prec)
{
mpfr_init2 (MPC_RE(x), prec);
mpfr_init2 (MPC_IM(x), prec);
diff --git a/src/init3.c b/src/init3.c
index a7247ac..89e575c 100644
--- a/src/init3.c
+++ b/src/init3.c
@@ -22,7 +22,7 @@ MA 02111-1307, USA. */
#include "mpc-impl.h"
void
-mpc_init3 (mpc_t x, mp_prec_t prec_re, mp_prec_t prec_im)
+mpc_init3 (mpc_t x, mpfr_prec_t prec_re, mpfr_prec_t prec_im)
{
mpfr_init2 (MPC_RE(x), prec_re);
mpfr_init2 (MPC_IM(x), prec_im);
diff --git a/src/log.c b/src/log.c
index 96d121b..510dc60 100644
--- a/src/log.c
+++ b/src/log.c
@@ -25,7 +25,7 @@ int
mpc_log (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd){
int ok=0;
mpfr_t w;
- mp_prec_t prec;
+ mpfr_prec_t prec;
int loops = 0;
int re_cmp, im_cmp;
int inex_re, inex_im;
diff --git a/src/mpc-impl.h b/src/mpc-impl.h
index e5fb80b..d12fd18 100644
--- a/src/mpc-impl.h
+++ b/src/mpc-impl.h
@@ -36,7 +36,7 @@ MA 02111-1307, USA. */
#define MPC_IM(x) ((x)->im)
/*
- * Miscelaneous useful macros
+ * Miscellaneous useful macros
*/
#define MPC_MAX(h,i) ((h) > (i) ? (h) : (i))
@@ -150,7 +150,7 @@ __MPC_DECLSPEC int mpc_mul_karatsuba __MPC_PROTO ((mpc_ptr, mpc_srcptr, mpc_src
__MPC_DECLSPEC char* mpc_alloc_str __MPC_PROTO ((size_t));
__MPC_DECLSPEC char* mpc_realloc_str __MPC_PROTO ((char*, size_t, size_t));
__MPC_DECLSPEC void mpc_free_str __MPC_PROTO ((char*));
-__MPC_DECLSPEC mp_prec_t mpc_ceil_log2 __MPC_PROTO ((unsigned long));
+__MPC_DECLSPEC mpfr_prec_t mpc_ceil_log2 __MPC_PROTO ((unsigned long));
#if defined (__cplusplus)
}
diff --git a/src/mpc.h b/src/mpc.h
index 1d83e5f..394e95c 100644
--- a/src/mpc.h
+++ b/src/mpc.h
@@ -211,11 +211,11 @@ __MPC_DECLSPEC int mpc_acosh __MPC_PROTO ((mpc_ptr, mpc_srcptr, mpc_rnd_t));
__MPC_DECLSPEC int mpc_atanh __MPC_PROTO ((mpc_ptr, mpc_srcptr, mpc_rnd_t));
__MPC_DECLSPEC void mpc_clear __MPC_PROTO ((mpc_ptr));
__MPC_DECLSPEC int mpc_urandom __MPC_PROTO ((mpc_ptr, gmp_randstate_t));
-__MPC_DECLSPEC void mpc_init2 __MPC_PROTO ((mpc_ptr, mp_prec_t));
-__MPC_DECLSPEC void mpc_init3 __MPC_PROTO ((mpc_ptr, mp_prec_t, mp_prec_t));
-__MPC_DECLSPEC mp_prec_t mpc_get_prec __MPC_PROTO((mpc_srcptr x));
-__MPC_DECLSPEC void mpc_get_prec2 __MPC_PROTO((mp_prec_t *pr, mp_prec_t *pi, mpc_srcptr x));
-__MPC_DECLSPEC void mpc_set_prec __MPC_PROTO ((mpc_ptr, mp_prec_t));
+__MPC_DECLSPEC void mpc_init2 __MPC_PROTO ((mpc_ptr, mpfr_prec_t));
+__MPC_DECLSPEC void mpc_init3 __MPC_PROTO ((mpc_ptr, mpfr_prec_t, mpfr_prec_t));
+__MPC_DECLSPEC mpfr_prec_t mpc_get_prec __MPC_PROTO((mpc_srcptr x));
+__MPC_DECLSPEC void mpc_get_prec2 __MPC_PROTO((mpfr_prec_t *pr, mpfr_prec_t *pi, mpc_srcptr x));
+__MPC_DECLSPEC void mpc_set_prec __MPC_PROTO ((mpc_ptr, mpfr_prec_t));
__MPC_DECLSPEC __gmp_const char * mpc_get_version __MPC_PROTO ((void));
__MPC_DECLSPEC int mpc_strtoc _MPFR_PROTO ((mpc_ptr, const char *, char **, int, mpc_rnd_t));
diff --git a/src/mul.c b/src/mul.c
index 1fc4885..f0b2f86 100644
--- a/src/mul.c
+++ b/src/mul.c
@@ -118,7 +118,7 @@ mpc_mul (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
return mpc_mul_naive (a, b, c, rnd);
else
return ((MPC_MAX_PREC(a)
- <= (mp_prec_t) MUL_KARATSUBA_THRESHOLD * BITS_PER_MP_LIMB)
+ <= (mpfr_prec_t) MUL_KARATSUBA_THRESHOLD * BITS_PER_MP_LIMB)
? mpc_mul_naive : mpc_mul_karatsuba) (a, b, c, rnd);
}
@@ -242,7 +242,7 @@ mpc_mul_naive (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
{
int overlap, inex_re, inex_im;
mpfr_t u, v, t;
- mp_prec_t prec;
+ mpfr_prec_t prec;
overlap = (a == b) || (a == c);
@@ -295,7 +295,7 @@ mpc_mul_karatsuba (mpc_ptr rop, mpc_srcptr op1, mpc_srcptr op2, mpc_rnd_t rnd)
mpfr_srcptr a, b, c, d;
int mul_i, ok, inexact, mul_a, mul_c, inex_re, inex_im, sign_x, sign_u;
mpfr_t u, v, w, x;
- mp_prec_t prec, prec_re, prec_u, prec_v, prec_w;
+ mpfr_prec_t prec, prec_re, prec_u, prec_v, prec_w;
mp_rnd_t rnd_re, rnd_u, rnd_x;
int overlap;
/* true if rop == op1 or rop == op2 */
@@ -423,7 +423,7 @@ mpc_mul_karatsuba (mpc_ptr rop, mpc_srcptr op1, mpc_srcptr op2, mpc_rnd_t rnd)
compute v - w exactly */
if (inexact == 0)
{
- mp_prec_t prec_x;
+ mpfr_prec_t prec_x;
if (mpfr_zero_p(v))
prec_x = prec_w;
else if (mpfr_zero_p(w))
diff --git a/src/norm.c b/src/norm.c
index 0ede6eb..3630b1d 100644
--- a/src/norm.c
+++ b/src/norm.c
@@ -26,7 +26,7 @@ int
mpc_norm (mpfr_ptr a, mpc_srcptr b, mpfr_rnd_t rnd)
{
mpfr_t u, v;
- mp_prec_t prec;
+ mpfr_prec_t prec;
int inexact, overflow;
prec = MPFR_PREC(a);
diff --git a/src/pow.c b/src/pow.c
index ba154a1..0fd4252 100644
--- a/src/pow.c
+++ b/src/pow.c
@@ -106,7 +106,7 @@ mpc_perfect_square_p (mpz_t a, mpz_t b, mpz_t c, mpz_t d)
*/
static int
mpc_pow_exact (mpc_ptr z, mpc_srcptr x, mpfr_srcptr y, mpc_rnd_t rnd,
- mp_prec_t maxprec)
+ mpfr_prec_t maxprec)
{
mp_exp_t ec, ed, ey, emin, emax;
mpz_t my, a, b, c, d, u;
@@ -149,14 +149,14 @@ mpc_pow_exact (mpc_ptr z, mpc_srcptr x, mpfr_srcptr y, mpc_rnd_t rnd,
if (ec < ed)
{
mpz_mul_2exp (d, d, ed - ec);
- if ((mp_prec_t) mpz_sizeinbase (d, 2) > maxprec)
+ if ((mpfr_prec_t) mpz_sizeinbase (d, 2) > maxprec)
goto end;
ed = ec;
}
else if (ed < ec)
{
mpz_mul_2exp (c, c, ec - ed);
- if ((mp_prec_t) mpz_sizeinbase (c, 2) > maxprec)
+ if ((mpfr_prec_t) mpz_sizeinbase (c, 2) > maxprec)
goto end;
ec = ed;
}
@@ -294,8 +294,8 @@ mpc_pow_exact (mpc_ptr z, mpc_srcptr x, mpfr_srcptr y, mpc_rnd_t rnd,
mpz_tdiv_q_2exp (b, b, w);
ed += w;
}
- if ( (mp_prec_t) mpz_sizeinbase (a, 2) > maxprec
- || (mp_prec_t) mpz_sizeinbase (b, 2) > maxprec)
+ if ( (mpfr_prec_t) mpz_sizeinbase (a, 2) > maxprec
+ || (mpfr_prec_t) mpz_sizeinbase (b, 2) > maxprec)
goto end;
}
/* now a+I*b = (c+I*d)^my */
@@ -320,8 +320,8 @@ mpc_pow_exact (mpc_ptr z, mpc_srcptr x, mpfr_srcptr y, mpc_rnd_t rnd,
mpz_tdiv_q_2exp (b, b, sa);
ed += sa;
- if ( (mp_prec_t) mpz_sizeinbase (a, 2) > maxprec
- || (mp_prec_t) mpz_sizeinbase (b, 2) > maxprec)
+ if ( (mpfr_prec_t) mpz_sizeinbase (a, 2) > maxprec
+ || (mpfr_prec_t) mpz_sizeinbase (b, 2) > maxprec)
goto end;
}
@@ -361,7 +361,7 @@ static int
is_odd (mpfr_srcptr y, mp_exp_t k)
{
mp_exp_t expo;
- mp_prec_t prec;
+ mpfr_prec_t prec;
mp_size_t yn;
mp_limb_t *yp;
@@ -406,7 +406,7 @@ mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
{
int ret = -2, loop, x_real, y_real, z_real = 0, z_imag = 0;
mpc_t t, u;
- mp_prec_t p, q, pr, pi, maxprec;
+ mpfr_prec_t p, q, pr, pi, maxprec;
long Q;
x_real = mpfr_zero_p (MPC_IM(x));
diff --git a/src/pow_ui.c b/src/pow_ui.c
index bb73e4c..5b83438 100644
--- a/src/pow_ui.c
+++ b/src/pow_ui.c
@@ -41,7 +41,7 @@ mpc_pow_ui (mpc_ptr z, mpc_srcptr x, unsigned long y, mpc_rnd_t rnd)
{
int inex;
mpc_t t, x3;
- mp_prec_t p;
+ mpfr_prec_t p;
unsigned long l, l0, u;
int has3; /* non-zero if y has '11' in its binary representation */
int loop, done;
@@ -112,7 +112,7 @@ mpc_pow_ui (mpc_ptr z, mpc_srcptr x, unsigned long y, mpc_rnd_t rnd)
}
else {
mp_exp_t diff;
- mp_prec_t er, ei;
+ mpfr_prec_t er, ei;
diff = mpfr_get_exp (MPC_RE(t)) - mpfr_get_exp (MPC_IM(t));
/* the factor on the real part is 2+2^(-diff+2) <= 4 for diff >= 1
and <= 2^(-diff+3) for diff <= 0 */
@@ -127,7 +127,7 @@ mpc_pow_ui (mpc_ptr z, mpc_srcptr x, unsigned long y, mpc_rnd_t rnd)
inex = mpc_set (z, t, rnd);
done = 1;
}
- else if (loop == 1 && SAFE_ABS(mp_prec_t, diff) < MPC_MAX_PREC(z)) {
+ else if (loop == 1 && SAFE_ABS(mpfr_prec_t, diff) < MPC_MAX_PREC(z)) {
/* common case, make a second trial at higher precision */
p += MPC_MAX_PREC(x);
mpc_set_prec (t, p);
diff --git a/src/set_prec.c b/src/set_prec.c
index c030b80..8aa00e6 100644
--- a/src/set_prec.c
+++ b/src/set_prec.c
@@ -22,7 +22,7 @@ MA 02111-1307, USA. */
#include "mpc-impl.h"
void
-mpc_set_prec (mpc_t x, mp_prec_t prec)
+mpc_set_prec (mpc_t x, mpfr_prec_t prec)
{
mpfr_set_prec (MPC_RE(x), prec);
mpfr_set_prec (MPC_IM(x), prec);
diff --git a/src/sin.c b/src/sin.c
index 9b90c0f..ba1276d 100644
--- a/src/sin.c
+++ b/src/sin.c
@@ -25,7 +25,7 @@ int
mpc_sin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
mpfr_t x, y, z;
- mp_prec_t prec;
+ mpfr_prec_t prec;
int ok = 0;
int inex_re, inex_im;
diff --git a/src/sqr.c b/src/sqr.c
index 3cef847..7c0c421 100644
--- a/src/sqr.c
+++ b/src/sqr.c
@@ -30,7 +30,7 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
mpfr_t x;
/* rop temporary variable to hold the real part of op,
needed in the case rop==op */
- mp_prec_t prec;
+ mpfr_prec_t prec;
int inex_re, inex_im, inexact;
mp_exp_t old_emax, old_emin, emin, emax;
diff --git a/src/sqrt.c b/src/sqrt.c
index 5c0b2f0..500b7e0 100644
--- a/src/sqrt.c
+++ b/src/sqrt.c
@@ -27,10 +27,10 @@ mpc_sqrt (mpc_ptr a, mpc_srcptr b, mpc_rnd_t rnd)
int ok_w, ok_t = 0;
mpfr_t w, t;
mp_rnd_t rnd_w, rnd_t;
- mp_prec_t prec_w, prec_t;
+ mpfr_prec_t prec_w, prec_t;
/* the rounding mode and the precision required for w and t, which can */
/* be either the real or the imaginary part of a */
- mp_prec_t prec;
+ mpfr_prec_t prec;
int inex_w, inex_t = 1, inex, loops = 0;
/* comparison of the real/imaginary part of b with 0 */
const int re_cmp = mpfr_cmp_ui (MPC_RE (b), 0);
diff --git a/src/tan.c b/src/tan.c
index 2154471..bc0d5bc 100644
--- a/src/tan.c
+++ b/src/tan.c
@@ -25,7 +25,7 @@ int
mpc_tan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
mpc_t x, y;
- mp_prec_t prec;
+ mpfr_prec_t prec;
mp_exp_t err;
int ok = 0;
int inex;
diff --git a/src/uceil_log2.c b/src/uceil_log2.c
index 11fe777..f46f4d9 100644
--- a/src/uceil_log2.c
+++ b/src/uceil_log2.c
@@ -23,7 +23,7 @@ MA 02111-1307, USA. */
/* returns ceil(log(d)/log(2)) if d > 0 */
/* Don't use count_leading_zeros since it is in longlong.h */
-mp_prec_t
+mpfr_prec_t
mpc_ceil_log2 (unsigned long d)
{
unsigned long exp;