Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!vsi1!daver!lynx!m5 From: m5@lynx.uucp (Mike McNally) Newsgroups: comp.lang.c Subject: More ANSI float.h stuff Summary: Epsilon confusion Message-ID: <5198@lynx.UUCP> Date: 18 Jan 89 16:39:51 GMT Reply-To: m5@lynx.UUCP (Mike McNally) Distribution: na Organization: Lynx Real-Time Systems Inc, Campbell CA Lines: 33 The file of the ANSI library contains two constants, FLT_EPSILON and DBL_EPSILON. These are (according to K&R II) supposed to be the smallest x such that 1.0 + x != 1.0. Should I interpret this as: The smallest x such that the statement i = (1.0 + x != 1.0); assigns 1 to the variable i. or should it be: The smallest x such that the sequence: val1 = 1.0; val2 = 1.0 + x; i = val1 != val2; results in assignment of 1 to the variable i. Seems to me that there is a difference, because intermediate results during expression evaluation may involve greater precision than available for storage of values. On a related note, the qualification that x be the "smallest" value bothers me: shouldn't x be positive? Most likely the actual ANSI draft is more specific; it probably clears up the first question as well. -- Mike McNally Lynx Real-Time Systems uucp: {voder,athsys}!lynx!m5 phone: 408 370 2233 Where equal mind and contest equal, go.