summaryrefslogtreecommitdiff
path: root/tests/tcbrt.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-10-18 10:21:31 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-10-18 10:21:31 +0000
commiteb521afa84f47be16e2259f9bccd7dcb4834be68 (patch)
treea637fb9f2e36abed858f3d9edc02c73af3c083ac /tests/tcbrt.c
parent65ede967bd1309ebf0ff509da0cad2cb736ecb1b (diff)
downloadmpfr-eb521afa84f47be16e2259f9bccd7dcb4834be68.tar.gz
Added some tests.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2061 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcbrt.c')
-rw-r--r--tests/tcbrt.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/tcbrt.c b/tests/tcbrt.c
index d30ebcac3..ed0b005bd 100644
--- a/tests/tcbrt.c
+++ b/tests/tcbrt.c
@@ -67,6 +67,26 @@ main (void)
fprintf (stderr, "\n");
exit (1);
}
+
+ if (p >= 5)
+ {
+ int i;
+ for (i = -12; i <= 12; i++)
+ {
+ mpfr_set_d (x, 27.0, GMP_RNDN);
+ mpfr_mul_2si (x, x, 3*i, GMP_RNDN);
+ mpfr_cbrt (x, x, GMP_RNDN);
+ if (mpfr_cmp_si_2exp (x, 3, i))
+ {
+ fprintf (stderr, "Error in mpfr_cbrt for "
+ "x = 27.0 * 2^(%d), rnd=%s\ngot ",
+ 3*i, mpfr_print_rnd_mode (r));
+ mpfr_out_str (stderr, 2, 0, x, GMP_RNDN);
+ fprintf (stderr, "\ninstead of 3 * 2^(%d)\n", i);
+ exit (1);
+ }
+ }
+ }
}
}