diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-01-16 16:01:55 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-01-16 16:01:55 +0000 |
commit | 53e4fc7c14c9c4b9b3be6b941d853ac1fcc7f81a (patch) | |
tree | 6ca0f6baf11496ffc528a474687f4326c00e9796 /tests/tmul.c | |
parent | 3d3b3c4428015d063a0b8b5b1519588ab37920d1 (diff) | |
download | mpfr-53e4fc7c14c9c4b9b3be6b941d853ac1fcc7f81a.tar.gz |
replaced isnan() by Isnan()
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2180 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tmul.c')
-rw-r--r-- | tests/tmul.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/tmul.c b/tests/tmul.c index c2d348747..533ceef5e 100644 --- a/tests/tmul.c +++ b/tests/tmul.c @@ -68,7 +68,8 @@ _check (double x, double y, double res, mp_rnd_t rnd_mode, unsigned int px, void check53 (double x, double y, mp_rnd_t rnd_mode, double z1) { - double z2; mpfr_t xx, yy, zz; + double z2; + mpfr_t xx, yy, zz; mpfr_init2 (xx, 53); mpfr_init2 (yy, 53); @@ -77,13 +78,16 @@ check53 (double x, double y, mp_rnd_t rnd_mode, double z1) mpfr_set_d (yy, y, rnd_mode); mpfr_mul (zz, xx, yy, rnd_mode); z2 = mpfr_get_d1 (zz); - if (z1!=z2 && (!isnan(z1) || !isnan(z2))) { - printf("mpfr_mul failed for x=%1.20e y=%1.20e with rnd_mode=%s\n", - x, y, mpfr_print_rnd_mode(rnd_mode)); - printf("correct result is %1.20e, mpfr_mul gives %1.20e\n", z1, z2); - exit(1); - } - mpfr_clear(xx); mpfr_clear(yy); mpfr_clear(zz); + if (z1 != z2 && !(Isnan(z1) && Isnan(z2))) + { + printf ("mpfr_mul failed for x=%1.20e y=%1.20e with rnd_mode=%s\n", + x, y, mpfr_print_rnd_mode(rnd_mode)); + printf ("correct result is %1.20e, mpfr_mul gives %1.20e\n", z1, z2); + exit (1); + } + mpfr_clear (xx); + mpfr_clear (yy); + mpfr_clear (zz); } /* checks that x*y gives the same results in double |