diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-03-03 16:51:07 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-03-03 16:51:07 +0000 |
commit | f5f7883fc7cf47d38ed493a882fd7109bdd589bb (patch) | |
tree | 1058cf0d07593fa2cec9f32b4988ac40611b4bff /tests/tmul_ui.c | |
parent | cbd40e1cb659b579e608afbe7a05da5b15a860be (diff) | |
download | mpfr-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/tmul_ui.c')
-rw-r--r-- | tests/tmul_ui.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/tests/tmul_ui.c b/tests/tmul_ui.c index e947fb8b3..f1a32b4f7 100644 --- a/tests/tmul_ui.c +++ b/tests/tmul_ui.c @@ -39,14 +39,14 @@ check_inexact (mp_prec_t p) mpfr_init2 (z, p + mp_bits_per_limb); mpfr_urandomb (x, RANDS); u = randlimb (); - if (mpfr_mul_ui (z, x, u, GMP_RNDN)) + if (mpfr_mul_ui (z, x, u, MPFR_RNDN)) { printf ("Error: result should be exact\n"); exit (1); } for (q = 2; q <= p; q++) - for (rnd = 0; rnd < GMP_RND_MAX; rnd++) + for (rnd = 0; rnd < MPFR_RND_MAX; rnd++) { mpfr_set_prec (y, q); inexact = mpfr_mul_ui (y, x, u, (mp_rnd_t) rnd); @@ -63,8 +63,8 @@ check_inexact (mp_prec_t p) } mpfr_set_prec (x, 2); - mpfr_set_ui (x, 1, GMP_RNDN); - if (mpfr_mul_ui (x, x, 5, GMP_RNDZ) == 0) + mpfr_set_ui (x, 1, MPFR_RNDN); + if (mpfr_mul_ui (x, x, 5, MPFR_RNDZ) == 0) { printf ("mul_ui(1, 5) cannot be exact with prec=2\n"); exit (1); @@ -98,8 +98,8 @@ main (int argc, char *argv[]) mpfr_init2 (y, 53); /* checks that result is normalized */ - mpfr_set_str (y, "6.93147180559945286227e-01", 10, GMP_RNDZ); - mpfr_mul_ui (x, y, 1, GMP_RNDZ); + mpfr_set_str (y, "6.93147180559945286227e-01", 10, MPFR_RNDZ); + mpfr_mul_ui (x, y, 1, MPFR_RNDZ); if (MPFR_MANT(x)[MPFR_PREC(x)/mp_bits_per_limb] >> (mp_bits_per_limb-1) == 0) { printf ("Error in mpfr_mul_ui: result not normalized\n"); @@ -114,7 +114,7 @@ main (int argc, char *argv[]) } mpfr_set_inf (x, 1); - mpfr_mul_ui (x, x, 3, GMP_RNDU); + mpfr_mul_ui (x, x, 3, MPFR_RNDU); if (!mpfr_inf_p (x) || (mpfr_sgn (x) <= 0)) { printf ("Error in mpfr_mul_ui: +Inf*3 does not give +Inf\n"); @@ -122,7 +122,7 @@ main (int argc, char *argv[]) } mpfr_set_inf (x, -1); - mpfr_mul_ui (x, x, 3, GMP_RNDU); + mpfr_mul_ui (x, x, 3, MPFR_RNDU); if (!mpfr_inf_p (x) || (mpfr_sgn (x) >= 0)) { printf ("Error in mpfr_mul_ui: -Inf*3 does not give -Inf\n"); @@ -130,7 +130,7 @@ main (int argc, char *argv[]) } mpfr_set_nan (x); - mpfr_mul_ui (x, x, 3, GMP_RNDU); + mpfr_mul_ui (x, x, 3, MPFR_RNDU); if (!mpfr_nan_p(x)) { printf ("Error in mpfr_mul_ui: NaN*3 does not give NaN\n"); @@ -138,23 +138,23 @@ main (int argc, char *argv[]) } mpfr_set_inf (x, 1); - mpfr_mul_ui (x, x, 0, GMP_RNDU); + mpfr_mul_ui (x, x, 0, MPFR_RNDU); MPFR_ASSERTN(mpfr_nan_p (x)); - mpfr_set_ui (x, 1, GMP_RNDU); - mpfr_mul_ui (x, x, 0, GMP_RNDU); + mpfr_set_ui (x, 1, MPFR_RNDU); + mpfr_mul_ui (x, x, 0, MPFR_RNDU); MPFR_ASSERTN(mpfr_cmp_ui (x, 0) == 0 && MPFR_IS_POS(x)); emax = mpfr_get_emax (); set_emax (0); mpfr_set_str_binary (x, "0.1E0"); - mpfr_mul_ui (x, x, 2, GMP_RNDN); + mpfr_mul_ui (x, x, 2, MPFR_RNDN); MPFR_ASSERTN(mpfr_inf_p (x) && MPFR_IS_POS(x)); set_emax (emax); mpfr_set_str (x, /*1.0/3.0*/ - "0.333333333333333333333333333333333", 10, GMP_RNDZ); - mpfr_mul_ui (x, x, 3, GMP_RNDU); + "0.333333333333333333333333333333333", 10, MPFR_RNDZ); + mpfr_mul_ui (x, x, 3, MPFR_RNDU); if (mpfr_cmp_ui (x, 1)) { printf ("Error in mpfr_mul_ui: U(Z(1/3)*3) does not give 1\n"); @@ -162,9 +162,9 @@ main (int argc, char *argv[]) } /* checks sign is correct */ - mpfr_set_si (x, -2, GMP_RNDZ); - mpfr_set_si (y, 3, GMP_RNDZ); - mpfr_mul_ui(x, y, 4, GMP_RNDZ); + mpfr_set_si (x, -2, MPFR_RNDZ); + mpfr_set_si (y, 3, MPFR_RNDZ); + mpfr_mul_ui(x, y, 4, MPFR_RNDZ); if (mpfr_cmp_ui(x, 0) <= 0) { printf("Error in mpfr_mul_ui: 4*3.0 does not give a positive result:\n"); @@ -176,7 +176,7 @@ main (int argc, char *argv[]) mpfr_set_prec (x, 9); mpfr_set_prec (y, 9); mpfr_set_str_binary (y, "0.100001111E9"); /* 271 */ - mpfr_mul_ui (x, y, 1335, GMP_RNDN); + mpfr_mul_ui (x, y, 1335, MPFR_RNDN); mpfr_set_str_binary (y, "0.101100001E19"); /* 361472 */ if (mpfr_cmp (x, y)) { @@ -189,7 +189,7 @@ main (int argc, char *argv[]) mpfr_set_prec(x, 100); /* y = 1199781142214086656 */ mpfr_set_str_binary(y, "0.1000010100110011110101001011110010101111000100001E61"); - mpfr_mul_ui(x, y, 121, GMP_RNDD); + mpfr_mul_ui(x, y, 121, MPFR_RNDD); /* 121*y = 145173518207904485376, representable exactly */ mpfr_set_str_binary(y, "0.1111101111010101111111100011010010111010111110110011001E67"); if (mpfr_cmp(x, y)) @@ -201,12 +201,12 @@ main (int argc, char *argv[]) mpfr_set_prec (x, 32); mpfr_set_str_binary (x, "0.10000000000000000000000000000000E1"); mpfr_set_prec (y, 93); - mpfr_mul_ui (y, x, 1, GMP_RNDN); + mpfr_mul_ui (y, x, 1, MPFR_RNDN); mpfr_set_prec (x, 287); mpfr_set_str_binary (x, "0.1111E7"); mpfr_set_prec (y, 289); - mpfr_mul_ui (y, x, 6, GMP_RNDN); + mpfr_mul_ui (y, x, 6, MPFR_RNDN); mpfr_set_str_binary (x, "0.101101E10"); if (mpfr_cmp (x, y)) { @@ -216,8 +216,8 @@ main (int argc, char *argv[]) mpfr_set_prec (x, 68); mpfr_set_prec (y, 64); - mpfr_set_str (x, "2143861251406875.0", 10, GMP_RNDN); - mpfr_mul_ui (y, x, 23, GMP_RNDN); + mpfr_set_str (x, "2143861251406875.0", 10, MPFR_RNDN); + mpfr_mul_ui (y, x, 23, MPFR_RNDN); mpfr_set_str_binary (x, "10101111001011100001100110101111110001010010011001101101.0"); if (mpfr_cmp (x, y)) { @@ -235,7 +235,7 @@ main (int argc, char *argv[]) for (yprec = 53; yprec <= 128; yprec++) { mpfr_set_prec (y, yprec); - mpfr_mul_ui (y, x, 1, GMP_RNDN); + mpfr_mul_ui (y, x, 1, MPFR_RNDN); if (mpfr_cmp(x,y)) { printf ("multiplication by 1.0 fails for xprec=%u, yprec=%u\n", @@ -248,11 +248,11 @@ main (int argc, char *argv[]) } mpfr_set_prec (x, 128); - mpfr_set_ui (x, 17, GMP_RNDN); - mpfr_mul_ui (x, x, ULONG_HIGHBIT, GMP_RNDN); + mpfr_set_ui (x, 17, MPFR_RNDN); + mpfr_mul_ui (x, x, ULONG_HIGHBIT, MPFR_RNDN); mpfr_set_prec (y, 128); - mpfr_set_ui (y, ULONG_HIGHBIT, GMP_RNDN); - mpfr_mul_ui (y, y, 17, GMP_RNDN); + mpfr_set_ui (y, ULONG_HIGHBIT, MPFR_RNDN); + mpfr_mul_ui (y, y, 17, MPFR_RNDN); if (mpfr_cmp (x, y)) { printf ("Error for 17 * ULONG_HIGHBIT\n"); @@ -262,11 +262,11 @@ main (int argc, char *argv[]) /* Check regression */ mpfr_set_prec (x, 32); mpfr_set_prec (y, 96); - mpfr_set_ui (x, 1742175942, GMP_RNDN); - mpfr_mul_ui (y, x, 59, GMP_RNDN); + mpfr_set_ui (x, 1742175942, MPFR_RNDN); + mpfr_mul_ui (y, x, 59, MPFR_RNDN); if (mpfr_cmp_str (y, "0.10111111011101010101000110111101000100000000000000" "0000000000000000000000000000000000000000000000E37", - 2, GMP_RNDN)) + 2, MPFR_RNDN)) { printf ("Regression tested failed for x=1742175942 * 59\n"); exit (1); |