HUGE_VAL and friends

Ray Butterworth rbutterworth at watmath.waterloo.edu
Fri Mar 24 00:48:36 AEST 1989


In article <63653 at pyramid.pyramid.com>, wendyt at 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)?




More information about the Comp.std.c mailing list