Path: utzoo!utgpu!watmath!rbutterworth From: rbutterworth@watmath.waterloo.edu (Ray Butterworth) Newsgroups: comp.std.c Subject: Re: HUGE_VAL and friends Keywords: mild confusion Message-ID: <24485@watmath.waterloo.edu> Date: 23 Mar 89 14:48:36 GMT References: <63653@pyramid.pyramid.com> Organization: U of Waterloo, Ontario Lines: 16 In article <63653@pyramid.pyramid.com>, wendyt@pyrps5 (Wendy Thrash) writes: > 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.) Actually, is there anything in the Standard that says what sort of value HUGE_VAL must have? e.g. could an implementation have HUGE_VAL defined as 1.0? There doesn't seem to be anything in the Standard that would disallow this value. A function that returns this value to indicate an error (e.g. strtod on overflow) must also set errno, just as it does when it returns 0.0 to indicate an underflow error. Given that, is there anything that a conforming program can rely on for the value of HUGE_VAL (other than it's being non-zero)?