Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!accelerator.eng.ohio-state.edu!kaa.eng.ohio-state.edu!rob From: rob@kaa.eng.ohio-state.edu (Rob Carriere) Newsgroups: comp.lang.c Subject: Re: Array indexing vs. pointers... Message-ID: <733@accelerator.eng.ohio-state.edu> Date: 9 Oct 88 00:52:25 GMT References: <836@proxftl.UUCP> <3105@hubcap.UUCP> <1700@dataio.Data-IO.COM> <1706@dataio.Data-IO.COM> <8273@alice.UUCP> Sender: news@accelerator.eng.ohio-state.edu Reply-To: rob@kaa.eng.ohio-state.edu (Rob Carriere) Organization: Ohio State Univ, College of Engineering Lines: 18 In article <8273@alice.UUCP> ark@alice.UUCP (Andrew Koenig) writes: >In particular, when >I convert 100 degrees Celsius to Fahrenheit [using * and /], I get 212, not >211.9999999999999 or 212.0000000000001. The other two ways of >doing it do not guarantee that. Probably. However, as thermometers more accurate than about +-.1K are fairly rare, what's the diff? You can't rely on the number being more precise than about +-.05 degrees F anyway, due to the inaccuracy of your input. This is exactly the point the original poster was trying to make; if *you* know the last couple of bits don't matter, you might as well take advantage of that fact. If on the other hand, this measurement was made using a Star Trek tricorder (which is accurate to 12 decimal places) and had to be reported to Spock, *then* you'd better be careful that you don't destroy any bits of accuracy, and use your trick (and double precision). Rob Carriere