summaryrefslogtreecommitdiff
path: root/tests/tget_d.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-08-11 14:56:47 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-08-11 14:56:47 +0000
commitffad6b1519a5b3f97e651c79305eeb62e2d25ba6 (patch)
tree61ce551ac5059a810b2c33e5c3214ebffd4ce555 /tests/tget_d.c
parentd00220d60ed54ef8f761353e9b551af5bf98bd52 (diff)
downloadmpfr-ffad6b1519a5b3f97e651c79305eeb62e2d25ba6.tar.gz
Added MPFR_DOUBLE_SPEC (not used yet, except for warning messages).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3711 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tget_d.c')
-rw-r--r--tests/tget_d.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/tests/tget_d.c b/tests/tget_d.c
index c66815e78..f8d86c326 100644
--- a/tests/tget_d.c
+++ b/tests/tget_d.c
@@ -164,26 +164,34 @@ check_min(void)
int
main (void)
{
- int non_ieee_dbl = 0;
-
tests_start_mpfr ();
mpfr_test_init ();
- if (FLT_RADIX != 2 || DBL_MANT_DIG != 53 ||
- DBL_MIN_EXP != -1021 || DBL_MAX_EXP != 1024)
- {
- printf ("The type 'double' of your C implementation does not seem\n"
- "to be in IEEE-754 double precision. We temporarily issue\n"
- "this error to detect machines that need special testing.\n"
- "If you have such a machine, please tell us. This error\n"
- "should be removed in releases.\n");
- printf ("FLT_RADIX = %ld\n", (long) FLT_RADIX);
- printf ("DBL_MANT_DIG = %ld\n", (long) DBL_MANT_DIG);
- printf ("DBL_MIN_EXP = %ld\n", (long) DBL_MIN_EXP);
- printf ("DBL_MAX_EXP = %ld\n", (long) DBL_MAX_EXP);
- non_ieee_dbl = 1;
- /* Let's do the other tests, to see if they pass or fail... */
- }
+#ifndef MPFR_DOUBLE_SPEC
+ printf ("Warning! The MPFR_DOUBLE_SPEC macro is not defined. This means\n"
+ "that you do not have a conforming C implementation and problems\n"
+ "may occur with conversions between MPFR numbers and standard\n"
+ "floating-point types. Please contact the MPFR team.\n");
+#elif MPFR_DOUBLE_SPEC == 0
+ /*
+ printf ("The type 'double' of your C implementation does not seem to\n"
+ "correspond to the IEEE-754 double precision. Though code has\n"
+ "been written to support such implementations, tests have been\n"
+ "done only on IEEE-754 double-precision implementations and\n"
+ "conversions between MPFR numbers and standard floating-point\n"
+ "types may be inaccurate. You may wish to contact the MPFR team\n"
+ "for further testing.\n");
+ */
+ printf ("The type 'double' of your C implementation does not seem to\n"
+ "correspond to the IEEE-754 double precision. Such particular\n"
+ "implementations are not supported yet, and conversions between\n"
+ "MPFR numbers and standard floating-point types may be very\n"
+ "inaccurate.\n");
+ printf ("FLT_RADIX = %ld\n", (long) FLT_RADIX);
+ printf ("DBL_MANT_DIG = %ld\n", (long) DBL_MANT_DIG);
+ printf ("DBL_MIN_EXP = %ld\n", (long) DBL_MIN_EXP);
+ printf ("DBL_MAX_EXP = %ld\n", (long) DBL_MAX_EXP);
+#endif
if (check_denorms ())
exit (1);
@@ -192,9 +200,6 @@ main (void)
check_min();
check_max();
- if (non_ieee_dbl)
- exit (1);
-
tests_end_mpfr ();
return 0;
}