summaryrefslogtreecommitdiff
path: root/tests/tset.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tset.c')
-rw-r--r--tests/tset.c13
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");