Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.unix.wizards Subject: Re: Floating Point Expectations Message-ID: <1601@charon.cwi.nl> Date: 5 Jun 90 20:13:00 GMT References: <1990May31.001618.24274@ico.isc.com> <1011@s6.Morgan.COM> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 17 Just a minor followup: In article moss@cs.umass.edu writes: > Just a minor followup to the (45.0 / 100.0) == .45 question: ... > One > *would* expect (50.0 / 100.0) == .50 since .50 *does* have an exact > representation in binary. I would not bet my money on it. If the evaluation of 50.0 / 100.0 is done using the hardware operation(s) to do division the result may very well not be exact. Try on a Cray: 3.0/3.0, 5.0/5.0, 7.0/7.0 etc. Some give exactly 1, others do not. (The Cray does not have division, but inversion followed by multiplication. And all those inverses are not exact.) Still worse, on a CDC 205 in double precision division by 2.0 need not be exact. -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl