diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-11-25 12:54:49 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-11-25 12:54:49 +0000 |
commit | 3cf9542cbfffcd1c66cbc4e396916d8527e67bd7 (patch) | |
tree | f1ab8b40b5dd709db4814a903b8105876307968e /tests/tsqrt_ui.c | |
parent | e01060829e30d5afa96c76e453cd7eff4a356395 (diff) | |
download | mpfr-3cf9542cbfffcd1c66cbc4e396916d8527e67bd7.tar.gz |
removed all tests that compare to libm
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2088 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsqrt_ui.c')
-rw-r--r-- | tests/tsqrt_ui.c | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/tests/tsqrt_ui.c b/tests/tsqrt_ui.c index 4d45a7198..64f2239c9 100644 --- a/tests/tsqrt_ui.c +++ b/tests/tsqrt_ui.c @@ -34,21 +34,14 @@ int maxulp=0; void check (unsigned long a, mp_rnd_t rnd_mode, double Q) { - mpfr_t q; double Q2; int u, ck; + mpfr_t q; double Q2; int u; mpfr_init2(q, 53); -#ifdef MPFR_HAVE_FESETROUND - mpfr_set_machine_rnd_mode(rnd_mode); -#endif mpfr_sqrt_ui(q, a, rnd_mode); - ck = (Q >= 0.0); - if (!ck) Q = sqrt(1.0 * a); Q2 = mpfr_get_d1 (q); if (Q!=Q2 && (!isnan(Q) || !isnan(Q2))) { u = ulp(Q2,Q); - if (ck) printf("mpfr_sqrt_ui failed"); - else printf("mpfr_sqrt_ui differs from sqrt"); - printf(" for a=%lu, rnd_mode=%s\n", + printf("mpfr_sqrt_ui failed for a=%lu, rnd_mode=%s\n", a, mpfr_print_rnd_mode(rnd_mode)); printf("sqrt gives %1.20e, mpfr_sqrt_ui gives %1.20e (%d ulp)\n",Q,Q2,u); exit(1); @@ -63,39 +56,6 @@ main (void) { tests_start_mpfr (); -#ifdef MPFR_HAVE_FESETROUND - { - int i; - unsigned long a; - - mpfr_test_init (); - - /* On Debian potato glibc 2.1.3-18, sqrt() doesn't seem to respect - fesetround. */ - { - double a, b; - mpfr_set_machine_rnd_mode (GMP_RNDU); - a = sqrt (five); - mpfr_set_machine_rnd_mode (GMP_RNDD); - b = sqrt (five); - if (a == b) - { - printf ("Tests suppressed, mpfr_set_machine_rnd_mode doesn't affect sqrt()\n"); - goto nogood; - } - } - - SEED_RAND (time(NULL)); - for (i=0;i<1000000;i++) - { - a = LONG_RAND(); - /* machine arithmetic must agree if a <= 2.0^53 */ - if (1.0*a < 9007199254872064.0) - check(a, LONG_RAND() % 4, -1.0); - } - nogood: ; - } -#endif check (0, GMP_RNDN, 0.0); check (2116118, GMP_RNDU, 1.45468828276026215e3); |