diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-10-14 12:13:37 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-10-14 12:13:37 +0000 |
commit | b666e8ed316c9843582161aaee40aa0605a53df3 (patch) | |
tree | 2f7b5be249c75c4d217c60ef58b5fafe277f98cb /tests/tacos.c | |
parent | b87636c5e4fa91836dd2bca51e6c60b5b23524e6 (diff) | |
download | mpfr-b666e8ed316c9843582161aaee40aa0605a53df3.tar.gz |
now uses #include "tgeneric.c" everywhere
(and modified test_generic to check also the inexact flag)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2496 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tacos.c')
-rw-r--r-- | tests/tacos.c | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/tests/tacos.c b/tests/tacos.c index db9b6c07a..67241dbe5 100644 --- a/tests/tacos.c +++ b/tests/tacos.c @@ -28,18 +28,18 @@ MA 02111-1307, USA. */ #include "mpfr-impl.h" #include "mpfr-test.h" +#define TEST_FUNCTION mpfr_acos +#include "tgeneric.c" + int main (void) { - unsigned int prec, err, yprec, n; - mp_rnd_t rnd; - mpfr_t x, y, z; + mpfr_t x, y; tests_start_mpfr (); mpfr_init (x); mpfr_init (y); - mpfr_init (z); MPFR_SET_NAN(x); mpfr_acos (y, x, GMP_RNDN); @@ -57,43 +57,10 @@ main (void) exit (1); } - for (prec = 2; prec <= 100; prec++) - { - mpfr_set_prec (x, prec); - mpfr_set_prec (z, prec); - yprec = prec + 10; - - for (n=0; n<7; n++) - { - mpfr_random (x); - rnd = randlimb () % 4; - mpfr_set_prec (y, yprec); - mpfr_acos (y, x, rnd); - err = (rnd == GMP_RNDN) ? yprec + 1 : yprec; - if (mpfr_can_round (y, err, rnd, rnd, prec)) - { - mpfr_prec_round (y, prec, rnd); - mpfr_acos (z, x, rnd); - if (mpfr_cmp (y, z)) - { - printf ("results differ for x="); - mpfr_out_str (stdout, 2, prec, x, GMP_RNDN); - printf (" prec=%u rnd_mode=%s\n", prec, - mpfr_print_rnd_mode (rnd)); - printf (" got "); - mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - puts (""); - printf (" expected "); - mpfr_out_str (stdout, 2, prec, y, GMP_RNDN); - puts (""); - } - } - } - } + test_generic (2, 100, 7); mpfr_clear (x); mpfr_clear (y); - mpfr_clear (z); tests_end_mpfr (); return 0; |