summaryrefslogtreecommitdiff
path: root/tests/tget_f.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-01-13 14:11:41 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-01-13 14:11:41 +0000
commit6ec10e95b44f7ed772d24fd16451c903e3ffa3ff (patch)
treedf8550b1d6db0efffa0c9d780cdc1bb9639107d1 /tests/tget_f.c
parent663ba8dbdb74de550fe800169201ec863750eee5 (diff)
downloadmpfr-6ec10e95b44f7ed772d24fd16451c903e3ffa3ff.tar.gz
The problem with the conversion was not completely fixed... Now OK.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4001 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tget_f.c')
-rw-r--r--tests/tget_f.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/tget_f.c b/tests/tget_f.c
index 1e1adcce7..da1f08eae 100644
--- a/tests/tget_f.c
+++ b/tests/tget_f.c
@@ -22,6 +22,7 @@ MA 02110-1301, USA. */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
+#include <limits.h>
#include "mpfr-test.h"
@@ -84,11 +85,14 @@ main (void)
printf ("Error: mpfr_get_f(%lu) fails\n", i);
exit (1);
}
- mpfr_set_si (y, - (long) i, GMP_RNDN);
- if (mpfr_get_f (x, y, GMP_RNDN) || mpf_cmp_si (x, - (long) i))
+ if (i <= - (unsigned long) LONG_MIN)
{
- printf ("Error: mpfr_get_f(-%lu) fails\n", i);
- exit (1);
+ mpfr_set_si (y, - (long) i, GMP_RNDN);
+ if (mpfr_get_f (x, y, GMP_RNDN) || mpf_cmp_si (x, - (long) i))
+ {
+ printf ("Error: mpfr_get_f(-%lu) fails\n", i);
+ exit (1);
+ }
}
i *= 2;
}