summaryrefslogtreecommitdiff
path: root/tests/tui_pow.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2009-03-03 16:51:07 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2009-03-03 16:51:07 +0000
commitf5f7883fc7cf47d38ed493a882fd7109bdd589bb (patch)
tree1058cf0d07593fa2cec9f32b4988ac40611b4bff /tests/tui_pow.c
parentcbd40e1cb659b579e608afbe7a05da5b15a860be (diff)
downloadmpfr-f5f7883fc7cf47d38ed493a882fd7109bdd589bb.tar.gz
GMP_RNDX -> MPFR_RNDX
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6053 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tui_pow.c')
-rw-r--r--tests/tui_pow.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/tests/tui_pow.c b/tests/tui_pow.c
index deec2b242..a15a1b254 100644
--- a/tests/tui_pow.c
+++ b/tests/tui_pow.c
@@ -38,12 +38,12 @@ test1 (void)
mpfr_init2 (a, 17);
mpfr_set_str_binary (x, "-0.101110001001011011011e-9");
- mpfr_ui_pow (y, 7, x, GMP_RNDN);
+ mpfr_ui_pow (y, 7, x, MPFR_RNDN);
mpfr_set_prec (x, 40);
mpfr_set_str_binary (x, "-0.1100101100101111011001010010110011110110E-1");
mpfr_set_prec (y, 74);
- mpfr_ui_pow (y, 8, x, GMP_RNDN);
+ mpfr_ui_pow (y, 8, x, MPFR_RNDN);
mpfr_set_prec (x, 74);
mpfr_set_str_binary (x, "0.11100000010100111101000011111011011010011000011000101011010011010101000011E-1");
if (mpfr_cmp (x, y))
@@ -53,14 +53,14 @@ test1 (void)
}
/* Check for ui_pow_ui */
- mpfr_ui_pow_ui (x, 0, 1, GMP_RNDN);
+ mpfr_ui_pow_ui (x, 0, 1, MPFR_RNDN);
MPFR_ASSERTN(mpfr_cmp_ui (x, 0) == 0 && MPFR_IS_POS (x));
- mpfr_ui_pow_ui (x, 0, 4, GMP_RNDN);
+ mpfr_ui_pow_ui (x, 0, 4, MPFR_RNDN);
MPFR_ASSERTN(mpfr_cmp_ui (x, 0) == 0 && MPFR_IS_POS (x));
- res1 = mpfr_ui_pow_ui (z, 17, 42, GMP_RNDD);
- mpfr_set_ui (x, 17, GMP_RNDN);
- mpfr_set_ui (y, 42, GMP_RNDN);
- res2 = mpfr_pow (a, x, y, GMP_RNDD);
+ res1 = mpfr_ui_pow_ui (z, 17, 42, MPFR_RNDD);
+ mpfr_set_ui (x, 17, MPFR_RNDN);
+ mpfr_set_ui (y, 42, MPFR_RNDN);
+ res2 = mpfr_pow (a, x, y, MPFR_RNDD);
if (mpfr_cmp (z, a) || res1 != res2)
{
printf ("Error for ui_pow_ui for 17^42\n"
@@ -70,8 +70,8 @@ test1 (void)
exit (1);
}
mpfr_set_prec (x, 2);
- mpfr_ui_pow_ui (x, 65537, 65535, GMP_RNDN);
- if (mpfr_cmp_str (x, "0.11E1048562", 2, GMP_RNDN) != 0)
+ mpfr_ui_pow_ui (x, 65537, 65535, MPFR_RNDN);
+ if (mpfr_cmp_str (x, "0.11E1048562", 2, MPFR_RNDN) != 0)
{
printf ("Error for ui_pow_ui for 65537 ^65535 with 2 bits of precision\n");
mpfr_dump (x);
@@ -101,7 +101,7 @@ check1 (mpfr_ptr x, mp_prec_t prec, unsigned long nt, mp_rnd_t rnd)
mpfr_set_prec (t, prec);
compare = mpfr_ui_pow (y, nt, x, rnd);
- err = (rnd == GMP_RNDN) ? yprec + 1 : yprec;
+ err = (rnd == MPFR_RNDN) ? yprec + 1 : yprec;
if (mpfr_can_round (y, err, rnd, rnd, prec))
{
mpfr_set (t, y, rnd);
@@ -109,15 +109,15 @@ check1 (mpfr_ptr x, mp_prec_t prec, unsigned long nt, mp_rnd_t rnd)
if (mpfr_cmp (t, z))
{
printf ("results differ for x=");
- mpfr_out_str (stdout, 2, prec, x, GMP_RNDN);
+ mpfr_out_str (stdout, 2, prec, x, MPFR_RNDN);
printf (" n=%lu", nt);
printf (" prec=%u rnd_mode=%s\n", (unsigned) prec,
mpfr_print_rnd_mode (rnd));
printf ("got ");
- mpfr_out_str (stdout, 2, prec, z, GMP_RNDN);
+ mpfr_out_str (stdout, 2, prec, z, MPFR_RNDN);
puts ("");
printf ("expected ");
- mpfr_out_str (stdout, 2, prec, t, GMP_RNDN);
+ mpfr_out_str (stdout, 2, prec, t, MPFR_RNDN);
puts ("");
printf ("approx ");
mpfr_print_binary (y);
@@ -127,7 +127,7 @@ check1 (mpfr_ptr x, mp_prec_t prec, unsigned long nt, mp_rnd_t rnd)
compare2 = mpfr_cmp (t, y);
/* if rounding to nearest, cannot know the sign of t - f(x)
because of composed rounding: y = o(f(x)) and t = o(y) */
- if ((rnd != GMP_RNDN) && (compare * compare2 >= 0))
+ if ((rnd != MPFR_RNDN) && (compare * compare2 >= 0))
compare = compare + compare2;
else
compare = inexact; /* cannot determine sign(t-f(x)) */
@@ -163,7 +163,7 @@ main (int argc, char *argv[])
n = randlimb ();
MPFR_SET_INF(x);
- mpfr_ui_pow (y, n, x, GMP_RNDN);
+ mpfr_ui_pow (y, n, x, MPFR_RNDN);
if(!MPFR_IS_INF(y))
{
printf ("evaluation of function in INF does not return INF\n");
@@ -171,7 +171,7 @@ main (int argc, char *argv[])
}
MPFR_CHANGE_SIGN(x);
- mpfr_ui_pow (y, n, x, GMP_RNDN);
+ mpfr_ui_pow (y, n, x, MPFR_RNDN);
if(!MPFR_IS_ZERO(y))
{
printf ("evaluation of function in -INF does not return 0");
@@ -179,7 +179,7 @@ main (int argc, char *argv[])
}
MPFR_SET_NAN(x);
- mpfr_ui_pow (y, n, x, GMP_RNDN);
+ mpfr_ui_pow (y, n, x, MPFR_RNDN);
if(!MPFR_IS_NAN(y))
{
printf ("evaluation of function in NAN does not return NAN");
@@ -202,17 +202,17 @@ main (int argc, char *argv[])
/* check exact power */
mpfr_set_str_binary (t, "0.110000E5");
- mpfr_ui_pow (z, 3, t, GMP_RNDN);
+ mpfr_ui_pow (z, 3, t, MPFR_RNDN);
mpfr_set_prec (x, 2);
mpfr_set_prec (y, 2);
- mpfr_set_str (x, "-0.5", 10, GMP_RNDZ);
- mpfr_ui_pow (y, 4, x, GMP_RNDD);
+ mpfr_set_str (x, "-0.5", 10, MPFR_RNDZ);
+ mpfr_ui_pow (y, 4, x, MPFR_RNDD);
if (mpfr_cmp_ui_2exp(y, 1, -1))
{
- fprintf (stderr, "Error for 4^(-0.5), prec=2, GMP_RNDD\n");
+ fprintf (stderr, "Error for 4^(-0.5), prec=2, MPFR_RNDD\n");
fprintf (stderr, "expected 0.5, got ");
- mpfr_out_str (stderr, 2, 0, y, GMP_RNDN);
+ mpfr_out_str (stderr, 2, 0, y, MPFR_RNDN);
fprintf (stderr, "\n");
exit (1);
}
@@ -221,13 +221,13 @@ main (int argc, char *argv[])
(03 Sep 2003) */
mpfr_set_prec (x, 2);
mpfr_set_prec (y, 2);
- mpfr_set_str (x, "0.5", 10, GMP_RNDN);
- mpfr_ui_pow (y, 398441521, x, GMP_RNDN);
+ mpfr_set_str (x, "0.5", 10, MPFR_RNDN);
+ mpfr_ui_pow (y, 398441521, x, MPFR_RNDN);
if (mpfr_cmp_ui_2exp(y, 1, 14))
{
- fprintf (stderr, "Error for 398441521^(0.5), prec=2, GMP_RNDN\n");
+ fprintf (stderr, "Error for 398441521^(0.5), prec=2, MPFR_RNDN\n");
fprintf (stderr, "expected 1.0e14, got ");
- mpfr_out_str (stderr, 2, 0, y, GMP_RNDN);
+ mpfr_out_str (stderr, 2, 0, y, MPFR_RNDN);
fprintf (stderr, "\n");
exit (1);
}
@@ -236,8 +236,8 @@ main (int argc, char *argv[])
mpfr_clear (t);
mpfr_set_prec (x, 2);
- mpfr_set_str (x, "0.5", 10, GMP_RNDN);
- check1 (x, 2, 398441521, GMP_RNDN); /* 398441521 = 19961^2 */
+ mpfr_set_str (x, "0.5", 10, MPFR_RNDN);
+ check1 (x, 2, 398441521, MPFR_RNDN); /* 398441521 = 19961^2 */
/* generic test */
for (prec = p0; prec <= p1; prec++)