summaryrefslogtreecommitdiff
path: root/tests/tset_f.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-01-12 10:12:29 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-01-12 10:12:29 +0000
commit2e55c6db6cde81cb5ea3b374c1920815e21515d2 (patch)
tree8a5940568782d8708b2ce24134b8dfda5ec81f2d /tests/tset_f.c
parent7ddebec8e851fb80c4b0b86e7d0f4eb99d53af5b (diff)
downloadmpfr-2e55c6db6cde81cb5ea3b374c1920815e21515d2.tar.gz
More reliable test for mpfr_set_f (x, y, GMP_RNDN) for y=2^ULONG_MAX.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3995 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tset_f.c')
-rw-r--r--tests/tset_f.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/tset_f.c b/tests/tset_f.c
index f8adb5601..2b5024777 100644
--- a/tests/tset_f.c
+++ b/tests/tset_f.c
@@ -88,8 +88,6 @@ main (void)
}
MPFR_ASSERTN(mpfr_cmp_ui_2exp (x, 1, 901) == 0);
- mpfr_clear (u);
-
for (k = 1; k <= 100000; k++)
{
pr = 2 + (randlimb () & 255);
@@ -135,7 +133,9 @@ main (void)
mpf_set_ui (y, 1);
mpf_mul_2exp (y, y, ULONG_MAX);
mpfr_set_f (x, y, GMP_RNDN);
- if (mpfr_inf_p (x) == 0 || mpfr_cmp_ui (x, 0) < 0)
+ mpfr_set_ui (u, 1, GMP_RNDN);
+ mpfr_mul_2ui (u, u, ULONG_MAX, GMP_RNDN);
+ if (!mpfr_equal_p (x, u))
{
printf ("Error: mpfr_set_f (x, y, GMP_RNDN) for y=2^ULONG_MAX\n");
exit (1);
@@ -160,6 +160,7 @@ main (void)
}
mpfr_clear (x);
+ mpfr_clear (u);
mpf_clear (y);
mpf_clear (z);