public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: HUGE_VAL should be Infinity
@ 2000-10-16 10:46 John David Anglin
  2000-10-16 18:35 ` Jeffrey A Law
  0 siblings, 1 reply; 22+ messages in thread
From: John David Anglin @ 2000-10-16 10:46 UTC (permalink / raw)
  To: gcc-patches

Under HP-UX 10.20 (and probably on other systems), HUGE_VAL is defined as
1.7976931348623157e+308 (same as DBL_MAX).  This is the maximum normalized
value for a double.  However, HUGE_VAL should actually be defined as
Infinity according to the hugeval.c testsuite program.

The following technique for defining HUGE_VAL was derived from that used
in the hugeval.c testsuite program and the linux bits/hugeval.h header.
It is considerably simpler than that used in bits/hugeval.h.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-10-14  J. David Anglin  <dave@hiauly1.hia.nrc.ca>

	* inclhack.def (hpux10_hugeval): New fix to correct definition
	of HUGE_VAL under HP-UX 10.X.

--- inclhack.def.orig	Fri Sep 29 14:23:52 2000
+++ inclhack.def	Mon Oct 16 12:22:29 2000
@@ -1569,6 +1571,27 @@
 };
 
 
+/*
+ * HUGE_VAL should be Infinity when doing IEEE math.  HP-UX 10.X uses the
+ * wrong value (DBL_MAX).  This fix should come after math_huge_val_ifndef.
+ */
+fix = {
+    hackname = math_huge_val_inf;
+    files    = math.h;
+    select    = "^#[ \t]*define[ \t]*HUGE_VAL[ \t]*1[.]7976931348623157e[+]308";
+
+    c_fix     = format;
+    c_fix_arg = "#  ifdef __STDC__\n"
+		"     static const double __huge_val = 1.0 / 0.0;\n"
+		"#  else\n"
+		"     static double __huge_val = 1.0 / 0.0;\n"
+		"#  endif\n"
+		"#  define HUGE_VAL (__huge_val)";
+
+    test_text = "# define\tHUGE_VAL 1.7976931348623157e+308";
+};
+
+
 /*
  * Fix nested comments in Motorola's <limits.h> and <sys/limits.h>
  */

^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <no.id>]

end of thread, other threads:[~2000-12-06 18:05 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-16 10:46 PATCH: HUGE_VAL should be Infinity John David Anglin
2000-10-16 18:35 ` Jeffrey A Law
2000-10-16 19:02   ` John David Anglin
2000-10-17  8:35     ` Jeffrey A Law
2000-10-16 20:21   ` Michael Meissner
2000-10-16 21:58     ` John David Anglin
2000-10-17  8:53       ` Jeffrey A Law
2000-10-17 11:51         ` John David Anglin
2000-10-17 18:51           ` Jeffrey A Law
2000-10-17 21:19             ` John David Anglin
2000-11-29 23:31               ` Jeffrey A Law
2000-11-30 10:23                 ` John David Anglin
2000-11-30 10:55                   ` Michael Meissner
2000-11-30 11:36                     ` John David Anglin
2000-10-18 14:03             ` PATCH: HUGE_VAL should be Infinity -- Yet another solution John David Anglin
2000-10-17 16:06         ` PATCH: HUGE_VAL should be Infinity: hugeval.c PATCH John David Anglin
     [not found] <no.id>
2000-11-30 12:16 ` PATCH: HUGE_VAL should be Infinity John David Anglin
2000-12-03 21:14   ` Jeffrey A Law
2000-12-04 10:52     ` Michael Meissner
2000-12-04 11:25       ` John David Anglin
2000-12-04 11:35         ` Jeffrey A Law
2000-12-06 18:05         ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).