diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-10-17 15:37:00 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-10-17 15:37:00 +0000 |
commit | 6ec93a1567fa34ca53aded6b43d921a63d8e4474 (patch) | |
tree | ee936733a709ff6c12c715848f797481d4ce3344 /tests/tset_ld.c | |
parent | af5c5e5d327c3b04cade0eee40f0e16d040d3bf7 (diff) | |
download | mpfr-6ec93a1567fa34ca53aded6b43d921a63d8e4474.tar.gz |
added check for +0 and -0
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2053 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tset_ld.c')
-rw-r--r-- | tests/tset_ld.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/tset_ld.c b/tests/tset_ld.c index a6eeac6fe..6e62ca293 100644 --- a/tests/tset_ld.c +++ b/tests/tset_ld.c @@ -69,11 +69,25 @@ main (int argc, char *argv[]) mpfr_init2 (x, 113); + /* check +0.0 and -0.0 */ + d = 0.0; + check_set_get (d, x); + d = -0.0; + check_set_get (d, x); + + /* checks that sign of -0.0 is set */ + mpfr_set_ld (x, -0.0, GMP_RNDN); + if (MPFR_SIGN(x) > 0) + { + fprintf (stderr, "Error: sign of -0.0 is not set correctly\n"); + exit (1); + } + /* checks NaN, Inf and -Inf */ mpfr_set_nan (x); d = mpfr_get_ld (x, GMP_RNDN); check_set_get (d, x); - + mpfr_set_inf (x, 1); d = mpfr_get_ld (x, GMP_RNDN); check_set_get (d, x); |