diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2015-01-21 14:22:35 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2015-01-21 14:22:35 +0000 |
commit | 13f0e99429497a81dd55847e9362fb26c3566b5b (patch) | |
tree | ce5a63da72b89c943b249254a729b04c88cf614f /tests | |
parent | 800c8140426b3865573c061a4da14366b7174745 (diff) | |
download | mpfr-13f0e99429497a81dd55847e9362fb26c3566b5b.tar.gz |
[tests/tset.c] More mpfr_set_zero tests.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9266 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tset.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/tset.c b/tests/tset.c index 82e7f04c8..537cb95c9 100644 --- a/tests/tset.c +++ b/tests/tset.c @@ -77,14 +77,23 @@ check_special (void) mpfr_set_zero (x, 1); PRINT_ERROR_IF (!mpfr_zero_p (x) || mpfr_sgn (x) < 0, - "ERROR: mpfr_set_zero failed to set variable to +0.\n"); + "ERROR: mpfr_set_zero failed to set variable to +0 [1].\n"); + mpfr_set_zero (x, INT_MAX); + PRINT_ERROR_IF (!mpfr_zero_p (x) || mpfr_sgn (x) < 0, + "ERROR: mpfr_set_zero failed to set variable to +0 [2].\n"); + mpfr_set_zero (x, 0); + PRINT_ERROR_IF (!mpfr_zero_p (x) || mpfr_sgn (x) < 0, + "ERROR: mpfr_set_zero failed to set variable to +0 [3].\n"); inexact = mpfr_set (y, x, MPFR_RNDN); PRINT_ERROR_IF (!mpfr_zero_p (y) || mpfr_sgn (y) < 0 || inexact != 0, "ERROR: mpfr_set failed to set variable to +0.\n"); mpfr_set_zero (x, -1); PRINT_ERROR_IF (!mpfr_zero_p (x) || mpfr_sgn (x) > 0, - "ERROR: mpfr_set_zero failed to set variable to -0.\n"); + "ERROR: mpfr_set_zero failed to set variable to -0 [1].\n"); + mpfr_set_zero (x, INT_MIN); + PRINT_ERROR_IF (!mpfr_zero_p (x) || mpfr_sgn (x) < 0, + "ERROR: mpfr_set_zero failed to set variable to -0 [2].\n"); inexact = mpfr_set (y, x, MPFR_RNDN); PRINT_ERROR_IF (!mpfr_zero_p (y) || mpfr_sgn (y) > 0 || inexact != 0, "ERROR: mpfr_set failed to set variable to -0.\n"); |