C needs BCD (ANSI People: Please Lis

Henry Spencer henry at utzoo.UUCP
Wed Nov 7 03:28:48 AEST 1984


> ...  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



More information about the Comp.lang.c mailing list