Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!ncis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: More ANSI float.h stuff Message-ID: <9432@smoke.BRL.MIL> Date: 19 Jan 89 13:13:28 GMT References: <5198@lynx.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Distribution: na Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 21 In article <5198@lynx.UUCP> m5@lynx.UUCP (Mike McNally) writes: >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. ... Funny, this question just came up a couple of days ago (perhaps in comp.std.c). The actual wording in the proposed Standard is "the difference between 1.0 and the least value greater than 1.0 that is representable in the given floating point type" with the formula for the floating point model given for clarification: b^(1-p). >Seems to me that there is a difference, because intermediate results during >expression evaluation may involve greater precision than available for >storage of values. Yes, that's permitted. The *_EPSILON constant applies to the storage representation for the floating-point types, which is often narrower than the representation used within a floating point arithmetic register. Reminder: This is my interpretation, not an official pronouncement.