summaryrefslogtreecommitdiff
path: root/tests/tpow.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2003-11-21 15:27:35 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2003-11-21 15:27:35 +0000
commit41d7b44241b63a451c3e664bdd9a640a4c255291 (patch)
tree6a82613a3cf86ab03825e93e2987ad51e8ab58a6 /tests/tpow.c
parent1cd11b42766c57e2118aac4ffe5219fac353904d (diff)
downloadmpfr-41d7b44241b63a451c3e664bdd9a640a4c255291.tar.gz
+ Add new internal function: mpfr_check.
+ Add the corresponding test file. + Translate mpfr_set_d to mpfr_set_str / mpfr_set_ui in the tests for portability reasons. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2562 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tpow.c')
-rw-r--r--tests/tpow.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/tpow.c b/tests/tpow.c
index c5f469bb8..0adb8a4b2 100644
--- a/tests/tpow.c
+++ b/tests/tpow.c
@@ -35,7 +35,7 @@ check_pow_ui (void)
mpfr_init2 (b, 53);
/* check in-place operations */
- mpfr_set_d (b, 0.6926773, GMP_RNDN);
+ mpfr_set_str (b, "0.6926773", 10, GMP_RNDN);
mpfr_pow_ui (a, b, 10, GMP_RNDN);
mpfr_pow_ui (b, b, 10, GMP_RNDN);
if (mpfr_cmp (a, b))
@@ -45,7 +45,7 @@ check_pow_ui (void)
}
/* check large exponents */
- mpfr_set_d (b, 1, GMP_RNDN);
+ mpfr_set_ui (b, 1, GMP_RNDN);
mpfr_pow_ui (a, b, 4294967295UL, GMP_RNDN);
mpfr_set_inf (a, -1);
@@ -122,8 +122,8 @@ check_inexact (mp_prec_t p)
mpfr_set_prec (x, p);
mpfr_set_prec (y, p);
mpfr_set_prec (z, p);
- mpfr_set_d (x, 4.0, GMP_RNDN);
- mpfr_set_d (y, 0.5, GMP_RNDN);
+ mpfr_set_ui (x, 4, GMP_RNDN);
+ mpfr_set_str (y, "0.5", 10, GMP_RNDN);
mpfr_pow (z, x, y, GMP_RNDZ);
mpfr_clear (x);
@@ -176,8 +176,8 @@ special ()
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_set_str (x, "5.68824667828621954868e-01", 10, GMP_RNDN);
+ mpfr_set_str (y, "9.03327850535952658895e-01", 10, GMP_RNDN);
mpfr_pow (z, x, y, GMP_RNDZ);
if (mpfr_get_d1 (z) != 0.60071044650456473235)
{
@@ -190,7 +190,7 @@ special ()
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_set_str (t, "-0.5", 10, GMP_RNDN);
mpfr_pow (z, x, t, GMP_RNDN);
mpfr_set_str (y, "1.01101001111010101110000101111e-1", 2, GMP_RNDN);
if (mpfr_cmp (z, y))
@@ -332,7 +332,7 @@ overflows (void)
/* bug found by Ming J. Tsai <mingjt@delvron.us>, 4 Oct 2003 */
- mpfr_init_set_d (a, 5.1e32, GMP_RNDN);
+ mpfr_init_set_str (a, "5.1e32", 10, GMP_RNDN);
mpfr_init (b);
mpfr_pow (b, a, a, GMP_RNDN);