summaryrefslogtreecommitdiff
path: root/tests/tjn.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2007-04-22 08:58:35 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2007-04-22 08:58:35 +0000
commit76971793ef8f7900086e192e1a804758909fe465 (patch)
tree3c66c94a45995c6ea8cd796f61c2ed94c404ea2d /tests/tjn.c
parent225446ac70ed6ef9ba703ffa8c070ca44b31f2fe (diff)
downloadmpfr-76971793ef8f7900086e192e1a804758909fe465.tar.gz
fixed bug for negative even index in mpfr_jn (wrong sign)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4409 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tjn.c')
-rw-r--r--tests/tjn.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/tjn.c b/tests/tjn.c
index 053301bd3..602ed7c48 100644
--- a/tests/tjn.c
+++ b/tests/tjn.c
@@ -129,6 +129,39 @@ main (int argc, char *argv[])
exit (1);
}
+ mpfr_set_ui (x, 1, GMP_RNDN);
+ mpfr_jn (y, -42, x, GMP_RNDN);
+ mpfr_set_str_binary (x, "0.10000111100011010100111011100111101101000100000001001E-211");
+ if (mpfr_cmp (x, y))
+ {
+ printf ("Error in mpfr_jn for n=-42, x=1, rnd=GMP_RNDN\n");
+ printf ("Expected "); mpfr_dump (x);
+ printf ("Got "); mpfr_dump (y);
+ exit (1);
+ }
+
+ mpfr_set_si (x, -1, GMP_RNDN);
+ mpfr_jn (y, 42, x, GMP_RNDN);
+ mpfr_set_str_binary (x, "0.10000111100011010100111011100111101101000100000001001E-211");
+ if (mpfr_cmp (x, y))
+ {
+ printf ("Error in mpfr_jn for n=42, x=-1, rnd=GMP_RNDN\n");
+ printf ("Expected "); mpfr_dump (x);
+ printf ("Got "); mpfr_dump (y);
+ exit (1);
+ }
+
+ mpfr_set_si (x, -1, GMP_RNDN);
+ mpfr_jn (y, -42, x, GMP_RNDN);
+ mpfr_set_str_binary (x, "0.10000111100011010100111011100111101101000100000001001E-211");
+ if (mpfr_cmp (x, y))
+ {
+ printf ("Error in mpfr_jn for n=-42, x=-1, rnd=GMP_RNDN\n");
+ printf ("Expected "); mpfr_dump (x);
+ printf ("Got "); mpfr_dump (y);
+ exit (1);
+ }
+
mpfr_set_ui (x, 17, GMP_RNDN);
mpfr_jn (y, 4, x, GMP_RNDN);
mpfr_set_str_binary (x, "-0.0001110001011001100010100111100111100000111110111011111");