summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-12-15 02:36:50 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-12-15 02:36:50 +0000
commit36927c5f52b5f5b0e53c477a92e6e41642b61fbe (patch)
tree0d8e2ce4289a8f9f4424fb22fe7187c2a1d9671d /tests
parent0d1b231885120e8ef9d5d71ea6e848f61771b453 (diff)
downloadmpfr-36927c5f52b5f5b0e53c477a92e6e41642b61fbe.tar.gz
[src/root.c] Completed fix from r11978, as x=-1 was affected too. Also
added comments explaining that mpfr_root_aux assumes |x| ≠ 1 and why. Hence the need of a filter on |x| = 1. [tests/troot.c] Added test for x = -1. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11980 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/troot.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/troot.c b/tests/troot.c
index ef905fa8a..947d3267c 100644
--- a/tests/troot.c
+++ b/tests/troot.c
@@ -467,8 +467,12 @@ bug20171214 (void)
mpfr_init2 (y, 837);
mpfr_set_ui (x, 1, MPFR_RNDN);
inex = TF (y, x, 120, MPFR_RNDN);
- MPFR_ASSERTN(inex == 0);
- MPFR_ASSERTN(mpfr_cmp_ui (y, 1) == 0);
+ MPFR_ASSERTN (inex == 0);
+ MPFR_ASSERTN (mpfr_cmp_ui (y, 1) == 0);
+ mpfr_set_si (x, -1, MPFR_RNDN);
+ inex = TF (y, x, 121, MPFR_RNDN);
+ MPFR_ASSERTN (inex == 0);
+ MPFR_ASSERTN (mpfr_cmp_si (y, -1) == 0);
mpfr_clear (x);
mpfr_clear (y);
}