summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/troot.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/troot.c b/tests/troot.c
index 6c6293f11..54f8489c7 100644
--- a/tests/troot.c
+++ b/tests/troot.c
@@ -189,6 +189,15 @@ special (void)
exit (1);
}
+ /* Check for k==2 */
+ mpfr_set_si (x, -17, GMP_RNDD);
+ i = mpfr_root (y, x, 2, GMP_RNDN);
+ if (!MPFR_IS_NAN (y) || i != 0)
+ {
+ printf ("Error in root (-17)^(1/2)\n");
+ exit (1);
+ }
+
mpfr_clear (x);
mpfr_clear (y);
}