Why 'C' does not need BCD...

Richard Harter g-rh at cca.UUCP
Thu Dec 13 22:53:12 AEST 1984


	Mr. Messinger writes at length and with marvellous sarcasm
about how much slower BCD arithmetic is than binary arithmetic.  This
is all very true IF THE MACHINE IN QUESTION DOES NOT SUPPORT BCD
ARITHMETIC.  On IBM mainframes, however, BCD arithmetic is supported
in HARDWARE and is as fast as binary arithmetic.  Lest we forget,
IBM has greater revenues than all of the rest of the computer industry
combined.

	There are, in fact, very good reasons for using BCD in
certain types of applications.  The most obvious is that it is much
cheaper to convert BCD numbers to decimal character strings than it
is to convert binary numbers to decimal character strings.  In
business applications BCD is superior -- if it is supported in
hardware.

	Since C is not a particularly convenient language to use
in an IBM shop and since almost nobody besides IBM supports hardware
BCD there seems to be little need for BCD in C.

				Richard Harter (SMDS Inc.)
				cca!g-rh



More information about the Comp.lang.c mailing list