summaryrefslogtreecommitdiff
path: root/tests/tcmp.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-05 13:23:58 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-05 13:23:58 +0000
commit49945294d135d2944f5184caf5b8b2a703f30c03 (patch)
tree74f657833cf5f1fe1a2733dee16d3bc2e643065f /tests/tcmp.c
parentb45b31567d35b0f67c7331a3ffbfffb668fb055d (diff)
downloadmpfr-49945294d135d2944f5184caf5b8b2a703f30c03.tar.gz
added new test for mpfr_cmp2
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@832 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcmp.c')
-rw-r--r--tests/tcmp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/tcmp.c b/tests/tcmp.c
index cdaae6b74..5563e1e88 100644
--- a/tests/tcmp.c
+++ b/tests/tcmp.c
@@ -44,8 +44,17 @@ int main()
if (mpfr_cmp2(xx,yy)!=64) { printf("Error (1) in mpfr_cmp\n"); exit(1); }
mpfr_set_str_raw(xx, "0.10100010001110110111000010001000010011111101000100011101000011100");
mpfr_set_str_raw(yy, "0.10100010001110110111000010001000010011111101000100011101000011011");
- if (mpfr_cmp2(xx,yy)!=64) { printf("Error (1) in mpfr_cmp\n"); exit(1); }
- mpfr_set_prec(xx,53); mpfr_set_prec(yy,200);
+ if (mpfr_cmp2(xx,yy)!=64) { printf("Error (2) in mpfr_cmp\n"); exit(1); }
+
+ mpfr_set_prec (xx, 160); mpfr_set_prec (yy, 160);
+ mpfr_set_str_raw (xx, "0.1E1");
+ mpfr_set_str_raw (yy, "0.11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000001100011101000001000111100001011101100111011101001101101111");
+ if (mpfr_cmp2 (xx, yy) != 144) {
+ printf("Error (3) in mpfr_cmp\n");
+ exit(1);
+ }
+
+ mpfr_set_prec(xx, 53); mpfr_set_prec(yy, 200);
mpfr_set_d(xx, 1.0, 0);
mpfr_set_d(yy, 1.0, 0);
if (mpfr_cmp(xx,yy)!=0) {