diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-09-29 13:58:06 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-09-29 13:58:06 +0000 |
commit | f2af580a8d5f41bc8fdebf7209c5a2959c83efc6 (patch) | |
tree | 049b34ab0e842b44e5d327a40a5001379d86c0fd /tests/tcmp_d.c | |
parent | f70d2f99fa9a99f09e1f9f602efe5930c079cee6 (diff) | |
download | mpfr-f2af580a8d5f41bc8fdebf7209c5a2959c83efc6.tar.gz |
cmp(x,y) if x=NAN or y=NAN returns 0 and erange flag.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3010 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcmp_d.c')
-rw-r--r-- | tests/tcmp_d.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/tcmp_d.c b/tests/tcmp_d.c index 8d9f25e14..270aa75c3 100644 --- a/tests/tcmp_d.c +++ b/tests/tcmp_d.c @@ -28,6 +28,7 @@ int main (void) { mpfr_t x; + int c; tests_start_mpfr (); @@ -66,6 +67,23 @@ main (void) exit (1); } + /* Check NAN */ + mpfr_clear_erangeflag (); + c = mpfr_cmp_d (x, DBL_NAN); + if (c != 0 || !mpfr_erangeflag_p ()) + { + printf ("ERROR for NAN (1)\n"); + exit (1); + } + mpfr_set_nan (x); + mpfr_clear_erangeflag (); + c = mpfr_cmp_d (x, 2.0); + if (c != 0 || !mpfr_erangeflag_p ()) + { + printf ("ERROR for NAN (2)\n"); + exit (1); + } + mpfr_clear(x); tests_end_mpfr (); |