Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.std.c Subject: Re: Questions about NCEG Message-ID: <1440@sdrc.UUCP> Date: 4 Jun 90 18:33:46 GMT References: <3094@goanna.cs.rmit.oz.au> <1990May29.193451.6533@twinsun.com> <15576@bfmny0.BFM.COM> Organization: SDRC, Cincinnati Lines: 26 In article <15576@bfmny0.BFM.COM>, tneff@bfmny0.BFM.COM (Tom Neff) writes: > >"If the scaled value is in the range of representable values (for its > >type) the result is either the nearest representable value, or the > >larger or smaller representable value immediately adjacent to the > >nearest representable value, chosen in an implementation-defined manner." > ^^^^^^^^^^^^^^^^^^^^^ > Does anyone else think this word choice is strange? I can understand > dealing with values outside the domain of exactly representable numbers > in this way -- let the compiler round up, down or to nearest as it sees > fit -- but if the target value is exactly representable, surely that > representation's use should be mandatory. As I recall, it was pointed out to us by someone far wiser in the matters of floating point than we, that requiring the compiler to get it exactly right was nearly impossible. Apparently, there are some values which would require (nearly?) infinite precision arithmetic to get exactly right. Even getting it to within one bit is exceedingly hard, which is why the standard allows for either of three values rather than just two. ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@SDRC.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150-2789 AT&T: (513) 576-2070 "You know how Einstein got bad grades as a kid? Well MINE are even WORSE!" -Calvin