summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorAllen Smith <allens@cpan.org>2002-09-07 01:25:45 -0400
committerhv <hv@crypt.org>2002-09-08 17:10:38 +0000
commit20f6aaab8d64a33be1150bb7a380a1b5d03267cb (patch)
treed31bbbbc33401f4b56b0e88fd778a96a0eaf4b5d /perl.h
parentd3d0e6f1233c0621cb4930e677ea82e761029cf7 (diff)
downloadperl-20f6aaab8d64a33be1150bb7a380a1b5d03267cb.tar.gz
Re: [PATCH: perl #17849] (corrected) Long double bugs - sprintf.t _and_ num.t
From: "Allen Smith" <easmith@beatrice.rutgers.edu> Message-Id: <10209070525.ZM1584639@puck2.rutgers.edu> p4raw-id: //depot/perl@17874
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/perl.h b/perl.h
index d1b369da57..f37ec83e2b 100644
--- a/perl.h
+++ b/perl.h
@@ -1186,6 +1186,27 @@ typedef UVTYPE UV;
# endif
#endif
+/*
+ * This is for making sure we have a good DBL_MAX value, if possible,
+ * either for usage as NV_MAX or for usage in figuring out if we can
+ * fit a given long double into a double, if bug-fixing makes it
+ * necessary to do so. - Allen <allens@cpan.org>
+ */
+
+#if defined(I_VALUES)
+# if !defined(USE_LONG_DOUBLE) || defined(HAS_LDBL_SPRINTF_BUG)
+# if (!defined(DBL_MIN) || !defined(DBL_MAX))
+# include <values.h>
+# if defined(MAXDOUBLE) && !defined(DBL_MAX)
+# define DBL_MAX MAXDOUBLE
+# endif
+# if defined(MINDOUBLE) && !defined(DBL_MIN)
+# define DBL_MIN MINDOUBLE
+# endif
+# endif
+# endif
+#endif
+
typedef NVTYPE NV;
#ifdef I_IEEEFP
@@ -1217,7 +1238,7 @@ typedef NVTYPE NV;
# endif
# ifdef LDBL_MAX
# define NV_MAX LDBL_MAX
-# define NV_MIN LDBL_MIN
+/* Having LDBL_MAX doesn't necessarily mean that we have LDBL_MIN... -Allen */
# else
# ifdef HUGE_VALL
# define NV_MAX HUGE_VALL