Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: Re: C needs BCD (ANSI People: Please Lis Message-ID: <4594@utzoo.UUCP> Date: Tue, 6-Nov-84 12:28:48 EST Article-I.D.: utzoo.4594 Posted: Tue Nov 6 12:28:48 1984 Date-Received: Tue, 6-Nov-84 12:28:48 EST References: <105@ISM780B.UUCP>, <869@ihuxn.UUCP> Organization: U of Toronto Zoology Lines: 28 > ... Let us assume that we had to choose between FP and BCD. How > should we choose TO SERVE THE LARGEST NUMBER OF CUSTOMERS. Back in > 1975 a side effect of some work I was doing was discovery that a large > fraction of the programs being written were business programs written > in COBOL. The fraction at that time was about 0.7 -- right, 70% of the > programs being written were being done in COBOL. Why? In large part, > said some business DP friends of mine, because COBOL works in decimal > numbers and does not screw up accounting and other business programs > (such as your payroll processing) by accumulating binary round-off > errors until pennies just disappear or magically appear driving the > accountants crazy. Your business DP friends are making a standard mistake of the ignorant: confusing the fixed-vs-floating-point distinction with binary-vs-decimal. Last I heard, there is *NOTHING* in the specs for Cobol which says that the numbers have to be implemented in decimal, although they have to *look* that way (to some extent) to the programmers. It is obvious that dollars-and-cents people cannot tolerate approximate arithmetic, i.e. floating-point. But binary fixed-point is no less precise than decimal fixed-point, and it's generally faster. In the 60's, Burroughs used binary arithmetic for the Cobol compilers on their 5500/6500 series; I believe there were some problems with the details of how they did things, but the basic idea worked just fine. -- "BCD arithmetic is an idea whose time has come... and gone." Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry