diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-11-14 12:47:01 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-11-14 12:47:01 +0000 |
commit | f3ec3c948ac523a73c8bae0e85592c87bc627a41 (patch) | |
tree | 492ba98413f2d85eee5ff193bc6c1ee1f9055632 /tests/tpow.c | |
parent | 4bf22b2dbe424148a8f5e1a61a29b32b6301cd94 (diff) | |
download | mpfr-f3ec3c948ac523a73c8bae0e85592c87bc627a41.tar.gz |
fixed bug in pow_si (exact result, case z = x)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2548 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tpow.c')
-rw-r--r-- | tests/tpow.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tpow.c b/tests/tpow.c index 2161d80e7..c5f469bb8 100644 --- a/tests/tpow.c +++ b/tests/tpow.c @@ -142,6 +142,22 @@ special () mpfr_init2 (z, 53); mpfr_init2 (t, 2); + mpfr_set_ui (x, 2, GMP_RNDN); + mpfr_pow_si (x, x, -2, GMP_RNDN); + if (mpfr_cmp_ui_2exp (x, 1, -2)) + { + printf ("Error in pow_si(x,x,-2) for x=2\n"); + exit (1); + } + mpfr_set_ui (x, 2, GMP_RNDN); + mpfr_set_si (y, -2, GMP_RNDN); + mpfr_pow (x, x, y, GMP_RNDN); + if (mpfr_cmp_ui_2exp (x, 1, -2)) + { + printf ("Error in pow(x,x,y) for x=2, y=-2\n"); + exit (1); + } + mpfr_set_prec (x, 64); mpfr_set_prec (y, 64); mpfr_set_prec (z, 64); |