Path: utzoo!attcan!uunet!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.lang.c Subject: Re: Inherent imprecision of floating point variables Message-ID: <1720@charon.cwi.nl> Date: 27 Jun 90 01:11:32 GMT References: <3300@crash.cts.com> <44436@ism780c.isc.com> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 21 In article <44436@ism780c.isc.com> marv@ism780.UUCP (Marvin Rubenstein) writes: (Replying to articles dealing with exact arithmetic using floating point) > The problem has nothing to do with C or the precision of the machine's > floating point unit. It has to do with the precision of the ASCII to float > and float to ASCII conversion routines. The first sentence is correct; the second is bogus. As has been noticed before, it has to do with the impossiblility to represent all (decimal) numbers on machines that have a non-decimal representation for fp numbers. > This problem was addressed at the > SIGPLAN '90 conference on Program Language Design and Implementation. I did not read the papers from this conference, but if they address anything, it is not this problem. What they might have addressed is the problem how to write and read numbers such that a number once written and read back will have exactly the same internal representation (note the order: first write, next read back in). I doubt this however, because this problem has already been solved some 20 years ago (Algol 68 required it). There might have been improved algorithms. -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl