summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2012-04-27 12:39:54 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2012-04-27 12:39:54 +0000
commit2e2b299fedc39c288db478600f4cecaf1cfac3f2 (patch)
tree26437165678096c8f0fea88a59a2713301873597
parentbee08662245075794f71c32140c22e742c110c6d (diff)
downloadmpfr-2e2b299fedc39c288db478600f4cecaf1cfac3f2.tar.gz
[tests/tgamma.c] Improved testcase test20100709.
(merged changeset r8164 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8165 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--tests/tgamma.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/tgamma.c b/tests/tgamma.c
index 66fa3ffe3..d84a1371b 100644
--- a/tests/tgamma.c
+++ b/tests/tgamma.c
@@ -493,7 +493,8 @@ test20100709 (void)
mpfr_clear (y);
mpfr_clear (z);
- /* Similar bug for 64-bit machines. */
+ /* Similar test for 64-bit machines (also valid with a 32-bit exponent,
+ but will not trigger the bug). */
emin = mpfr_get_emin ();
mpfr_set_emin (MPFR_EMIN_MIN);
mpfr_init2 (x, 100);
@@ -507,12 +508,9 @@ test20100709 (void)
mpfr_sub (y, y, z, MPFR_RNDD); /* log(MIN/2) = log(MIN) - log(2) */
mpfr_lgamma (z, &sign, x, MPFR_RNDU);
MPFR_ASSERTN (sign == -1);
- if (mpfr_less_p (z, y)) /* true on 64-bit machines */
- {
- /* thus underflow */
- inex = mpfr_gamma (x, x, MPFR_RNDN);
- MPFR_ASSERTN (MPFR_IS_ZERO(x) && MPFR_IS_NEG(x) && inex > 0);
- }
+ MPFR_ASSERTN (mpfr_less_p (z, y)); /* thus underflow */
+ inex = mpfr_gamma (x, x, MPFR_RNDN);
+ MPFR_ASSERTN (MPFR_IS_ZERO(x) && MPFR_IS_NEG(x) && inex > 0);
mpfr_clear (x);
mpfr_clear (y);
mpfr_clear (z);