ANSI float.h

Mike McNally m5 at lynx.uucp
Tue Jan 17 06:54:59 AEST 1989


The new K&R almost-ANSI book has a little section in the back that describes 
the contents (well, part of the contents, apparently) of <float.h>.  I am
confused by some of the "minimum magnitude" values listed:

FLT_EPSILON 1e-5        Isn't that kind of big?  With IEEE single-precision,
                        the actual value according to the definition should
                        be something like 5.4e-8.

FLT_MIN     1e-37       Does this mean that an ANSI-compliant compiler
                        does not need to supply negative float values
                        beyond a negative itsy-bitsy value?  Does it
                        make sense that coding x=-2.0 results in a 
                        non-portable program?

I suppose I can live with FLT_EPSILON, but FLT_MIN bothers me.  Shouldn't
that be more like -1e37?

-- 
Mike McNally                                    Lynx Real-Time Systems
uucp: {voder,athsys}!lynx!m5                    phone: 408 370 2233

            Where equal mind and contest equal, go.



More information about the Comp.lang.c mailing list