Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!nsc!pyramid!wendyt From: wendyt@pyrps5 (Wendy Thrash) Newsgroups: comp.std.c Subject: HUGE_VAL and friends Keywords: mild confusion Message-ID: <63653@pyramid.pyramid.com> Date: 23 Mar 89 07:25:56 GMT Sender: daemon@pyramid.pyramid.com Reply-To: wendyt@pyrps5.pyramid.com (Wendy Thrash) Organization: Pyramid Technology Corp., Mountain View, CA Lines: 21 Because I have to supply a math.h and float.h that work for three different floating-point formats on otherwise compatible machines, I'd like very much to make HUGE_VAL and its friends (DBL_MAX, FLT_EPSILON, etc.) expand as function calls (to things like __huge_val(), __dbl_max(), etc.) Questions: 1) Does this violate the letter of the standard? 2) Does this violate the spirit of the standard? 3) Has all this been discussed already, so I'm an idiot for not remembering? The (Dec. 7 draft) standard allows these things to be general double expressions, so it's hard to see a violation of the letter of the standard. The rationale says that "the Committee decided to generalize HUGE_VAL to a positive double expression, so that it could be expressed as an external identifier naming a location initialized precisely with the proper bit pattern." This makes me wonder whether my calls violate the spirit of the standard, at least with respect to HUGE_VAL. It seems, BTW, that an implementation of HUGE_VAL as an external identifier would allow the user to redefine it on the fly, for instance HUGE_VAL = 42.; Must I allow this? (I certainly hope not.)