summaryrefslogtreecommitdiff
path: root/tests/troot.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-06-13 12:03:30 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-06-13 12:03:30 +0000
commit4e3062b51782d726f1fe92400d5ee677200e2e59 (patch)
tree053917036715e2060b894b03583da0501940c4c0 /tests/troot.c
parent2f2f940b8ceec0deb86ca4697c6c58725d7f8391 (diff)
downloadmpfr-4e3062b51782d726f1fe92400d5ee677200e2e59.tar.gz
Fix bug with x<0 and k even
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3647 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/troot.c')
-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);
}