summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-01-09 09:56:04 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-01-09 09:56:04 +0000
commit55f8382234e0308c076b915f829fa7a3cb9943fd (patch)
tree208f5ba2f8af949dd77071ecc590778fd3a1e447 /tests
parent99e448a7bbe6658f64dc7f172173f5edb379763e (diff)
downloadmpfr-55f8382234e0308c076b915f829fa7a3cb9943fd.tar.gz
added one test
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2153 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/tpow.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/tpow.c b/tests/tpow.c
index 2d5d80c75..000d96a6e 100644
--- a/tests/tpow.c
+++ b/tests/tpow.c
@@ -142,8 +142,25 @@ special ()
mpfr_init2 (y, 53);
mpfr_init2 (z, 53);
mpfr_init2 (t, 2);
- mpfr_set_d (t, -0.5, GMP_RNDN);
+ mpfr_set_prec (x, 64);
+ mpfr_set_prec (y, 64);
+ mpfr_set_prec (z, 64);
+ mpfr_set_prec (t, 64);
+ mpfr_set_str_raw (x, "0.111011000111100000111010000101010100110011010000011");
+ mpfr_set_str_raw (y, "0.111110010100110000011101100011010111000010000100101");
+ mpfr_set_str_raw (t, "0.1110110011110110001000110100100001001111010011111000010000011001");
+ ;
+ mpfr_pow (z, x, y, GMP_RNDN);
+ if (mpfr_cmp (z, t))
+ {
+ fprintf (stderr, "Error in mpfr_pow for prec=64, rnd=GMP_RNDN\n");
+ exit (1);
+ }
+
+ mpfr_set_prec (x, 53);
+ mpfr_set_prec (y, 53);
+ mpfr_set_prec (z, 53);
mpfr_set_d (x, 5.68824667828621954868e-01, GMP_RNDN);
mpfr_set_d (y, 9.03327850535952658895e-01, GMP_RNDN);
mpfr_pow (z, x, y, GMP_RNDZ);
@@ -153,10 +170,12 @@ special ()
exit (1);
}
+ mpfr_set_prec (t, 2);
mpfr_set_prec (x, 30);
mpfr_set_prec (y, 30);
mpfr_set_prec (z, 30);
mpfr_set_str (x, "1.00000000001010111110001111011e1", 2, GMP_RNDN);
+ mpfr_set_d (t, -0.5, GMP_RNDN);
mpfr_pow (z, x, t, GMP_RNDN);
mpfr_set_str (y, "1.01101001111010101110000101111e-1", 2, GMP_RNDN);
if (mpfr_cmp (z, y))