C needs BCD (ANSI People: Please Lis

Rich Strebendt res at ihuxn.UUCP
Tue Nov 6 09:31:04 AEST 1984


In response to:

| > One of the biggest problems with C is the lack of a BCD
| > (Binary Coded Decimal) arithmetic type.
| 
| PL/I has already been invented.  It has 11 million different flavors
| of arithmetic.  Why didn't you use it?  Too slow?  Not available?
| Think about why that might be.

Why does the author of this question think that might be?  I would be
willing to lay odds that he is dead wrong!!!  As to why I think so,
continue to my comments below:

| > Why should C provide floating point operations and not provide
| > BCD operations ?
| 
| Right.  So get rid of floating point :-).

I would like to take this last remark more seriously than the author
intended.  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.  I do not know what the current fraction of COBOL to
all other programs, but I suspect that it has not changed too
drastically in the past decade.  Compare that with the small number of
numerical processing customers requiring FP (or thinking that they do
because they have not learned to scale integers as in FORTH :-) ).
Why, then, has PL/I not caught on?  Because most businesses tend to be
conservative in their approach to matters that can hurt the bottom line
(COBOL programs are doing the job, why take the risk of switching to
another language that will cost the company money to train people to
use it, and represents some measure of risk?  Besides, we have a number
of people already trained in COBOL and can hire lots of others if we 
need them).

I will agree that PL/I suffered from trying to be all things to all
people and ended up doing none of them superlatively well, but that was
not why it did not catch on in the business DP community.  

Sooooo, if we have to decide between FP and BCD, the smart money would
be betting on BCD.  FP is of academic interest!


					Rich Strebendt
					...!ihnp4!ihuxn!res



More information about the Comp.lang.c mailing list