summaryrefslogtreecommitdiff
path: root/tests/troot.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/troot.c')
-rw-r--r--tests/troot.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/troot.c b/tests/troot.c
index c6649cf8c..e173db59a 100644
--- a/tests/troot.c
+++ b/tests/troot.c
@@ -405,6 +405,26 @@ cmp_pow (void)
mpfr_clears (x, y1, y2, (mpfr_ptr) 0);
}
+static void
+bug20171214 (void)
+{
+ mpfr_t x, y;
+ int inex;
+
+ mpfr_init2 (x, 805);
+ mpfr_init2 (y, 837);
+ mpfr_set_ui (x, 1, MPFR_RNDN);
+ inex = mpfr_root (y, x, 120, MPFR_RNDN);
+ MPFR_ASSERTN (inex == 0);
+ MPFR_ASSERTN (mpfr_cmp_ui (y, 1) == 0);
+ mpfr_set_si (x, -1, MPFR_RNDN);
+ inex = mpfr_root (y, x, 121, MPFR_RNDN);
+ MPFR_ASSERTN (inex == 0);
+ MPFR_ASSERTN (mpfr_cmp_si (y, -1) == 0);
+ mpfr_clear (x);
+ mpfr_clear (y);
+}
+
int
main (void)
{
@@ -415,6 +435,7 @@ main (void)
tests_start_mpfr ();
+ bug20171214 ();
exact_powers (3, 1000);
special ();
bigint ();