summaryrefslogtreecommitdiff
path: root/tests/troot.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-11-26 18:52:26 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-11-26 18:52:26 +0000
commit8190951ddce859149d9ff0eb492d9c696b202d76 (patch)
tree8608bb228ee4d90c884b760c3174bfccf00233bb /tests/troot.c
parent64f0ae48778f76b3f07546208161b8a483003f82 (diff)
downloadmpfr-8190951ddce859149d9ff0eb492d9c696b202d76.tar.gz
tests/troot.c: two more worst cases.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4296 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/troot.c')
-rw-r--r--tests/troot.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/troot.c b/tests/troot.c
index 5c27e6458..1fec6482a 100644
--- a/tests/troot.c
+++ b/tests/troot.c
@@ -156,6 +156,33 @@ special (void)
mpfr_dump (y);
exit (1);
}
+ /* Worst cases found on 2006-11-26 */
+ mpfr_set_str_binary (x, "1.1111010011101110001111010110000101110000110110101100E17");
+ mpfr_root (y, x, 36, GMP_RNDD);
+ mpfr_set_str_binary (x, "1.0110100111010001101001010111001110010100111111000010E0");
+ if (mpfr_cmp (x, y))
+ {
+ printf ("Error in mpfr_root (y, x, 36, GMP_RNDD) for\n"
+ "x = 1.1111010011101110001111010110000101110000110110101100E17\n"
+ "Expected ");
+ mpfr_dump (x);
+ printf ("Got ");
+ mpfr_dump (y);
+ exit (1);
+ }
+ mpfr_set_str_binary (x, "1.1100011101101101100010110001000001110001111110010000E23");
+ mpfr_root (y, x, 36, GMP_RNDU);
+ mpfr_set_str_binary (x, "1.1001010100001110000110111111100011011101110011000100E0");
+ if (mpfr_cmp (x, y))
+ {
+ printf ("Error in mpfr_root (y, x, 36, GMP_RNDU) for\n"
+ "x = 1.1100011101101101100010110001000001110001111110010000E23\n"
+ "Expected ");
+ mpfr_dump (x);
+ printf ("Got ");
+ mpfr_dump (y);
+ exit (1);
+ }
/* Check for k = 1 */
mpfr_set_ui (x, 17, GMP_RNDN);