summaryrefslogtreecommitdiff
path: root/tests/tpow.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tpow.c')
-rw-r--r--tests/tpow.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/tpow.c b/tests/tpow.c
index 9009eda40..dd2a1202c 100644
--- a/tests/tpow.c
+++ b/tests/tpow.c
@@ -51,15 +51,19 @@ check_pow_ui (void)
mpfr_set_inf (a, -1);
mpfr_pow_ui (a, a, 4049053855UL, GMP_RNDN);
- if (mpfr_get_d (a) != DBL_NEG_INF) {
- fprintf (stderr, "Error for (-Inf)^4049053855\n"); exit (1);
- }
+ if (!mpfr_inf_p (a) || (mpfr_sgn (a) >= 0))
+ {
+ fprintf (stderr, "Error for (-Inf)^4049053855\n");
+ exit (1);
+ }
mpfr_set_inf (a, -1);
mpfr_pow_ui (a, a, (unsigned long) 30002752, GMP_RNDN);
- if (mpfr_get_d (a) != DBL_POS_INF) {
- fprintf (stderr, "Error for (-Inf)^30002752\n"); exit (1);
- }
+ if (!mpfr_inf_p (a) || (mpfr_sgn (a) <= 0))
+ {
+ fprintf (stderr, "Error for (-Inf)^30002752\n");
+ exit (1);
+ }
mpfr_clear (a);
mpfr_clear (b);