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_ld.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_ld.c')
-rw-r--r-- | tests/tcmp_ld.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tcmp_ld.c b/tests/tcmp_ld.c index 51810d6ba..23ca045dc 100644 --- a/tests/tcmp_ld.c +++ b/tests/tcmp_ld.c @@ -27,6 +27,7 @@ int main (void) { mpfr_t x; + int c; tests_start_mpfr (); @@ -65,6 +66,24 @@ main (void) exit (1); } + /* Check NAN */ + mpfr_clear_erangeflag (); + c = mpfr_cmp_ld (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_ld (x, 2.0); + if (c != 0 || !mpfr_erangeflag_p ()) + { + printf ("ERROR for NAN (2)\n"); + exit (1); + } + + mpfr_clear(x); tests_end_mpfr (); |