diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 1999-12-16 10:59:26 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 1999-12-16 10:59:26 +0000 |
commit | 4347749aef4f544016cadbe05da5cf0dbf694460 (patch) | |
tree | 57343bbf7f1e6c2fa2278e4fd139d1bd492f9648 /tests/tcmp2.c | |
parent | 7939b4e8795b055864dbaa5664a151d58ff2e604 (diff) | |
download | mpfr-4347749aef4f544016cadbe05da5cf0dbf694460.tar.gz |
added one test
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@423 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcmp2.c')
-rw-r--r-- | tests/tcmp2.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/tcmp2.c b/tests/tcmp2.c index 631e575e7..ae61e9f82 100644 --- a/tests/tcmp2.c +++ b/tests/tcmp2.c @@ -47,6 +47,16 @@ void tcmp2(x, y, i) double x, y; int i; printf("Error in mpfr_cmp2: x=%1.20e y=%1.20e mpfr_cmp2(x,y)=%d instead of %d\n",x,y,j,i); exit(1); } + mpfr_set_prec(xx, 127); mpfr_set_prec(yy, 127); + mpfr_set_str_raw(xx, "0.1011010000110111111000000101011110110001000101101011011110010010011110010000101101000010011001100110010000000010110000101000101E6"); + mpfr_set_str_raw(yy, "0.1011010000110111111000000101011011111100011101000011001111000010100010100110110100110010011001100110010000110010010110000010110E6"); + if ((j=mpfr_cmp2(xx, yy)) != 32) { + printf("Error in mpfr_cmp2:\n"); + printf("x="); mpfr_print_raw(xx); putchar('\n'); + printf("y="); mpfr_print_raw(yy); putchar('\n'); + printf("got %d, expected 32\n", j); + exit(1); + } mpfr_clear(xx); mpfr_clear(yy); } |