summaryrefslogtreecommitdiff
path: root/tests/tset_ld.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-10-19 16:21:41 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-10-19 16:21:41 +0000
commit518becc383f29d0ac0fbaf585dd8743e7c813ff0 (patch)
treee81ccea224eb728d1952fced2a83fbdb37d7482b /tests/tset_ld.c
parent85613ee2a940ea04e88acd6bedab651df4f2f976 (diff)
downloadmpfr-518becc383f29d0ac0fbaf585dd8743e7c813ff0.tar.gz
[tests/*.c] Support the case where mpfr_exp_t is not a long int
(but with such a future extension, one should probably provide a MPFR_PRIexp macro, similar to what <inttypes.h> does). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7226 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tset_ld.c')
-rw-r--r--tests/tset_ld.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/tset_ld.c b/tests/tset_ld.c
index 85fe47860..274d489c0 100644
--- a/tests/tset_ld.c
+++ b/tests/tset_ld.c
@@ -72,9 +72,15 @@ check_set_get (long double d, mpfr_t x)
inex = mpfr_set_ld (x, d, (mpfr_rnd_t) r);
if (inex != 0)
{
+ mpfr_exp_t emin, emax;
+ emin = mpfr_get_emin ();
+ emax = mpfr_get_emax ();
printf ("Error: mpfr_set_ld should be exact\n");
printf ("d=%1.30Le inex=%d\n", d, inex);
- printf ("emin=%ld emax=%ld\n", mpfr_get_emin (), mpfr_get_emax ());
+ if (emin >= LONG_MIN)
+ printf ("emin=%ld\n", (long) emin);
+ if (emax <= LONG_MAX)
+ printf ("emax=%ld\n", (long) emax);
mpfr_dump (x);
exit (1);
}