C needs BCD (ANSI People: Please Lis

Kevin Martin kpmartin at watmath.UUCP
Fri Nov 9 12:18:25 AEST 1984


>I don't know about a BCD type, but it would be nice to have a %b
>input and output format for use in printf and scanf.
>{philabs,cmcl2!rocky2}!cubsvax!peters            Dr. Peter S. Shenkin 


The thing I find amusing is that, when this particular discussion started
with the mention of BCD, I immediately thought of the funny 6-bit character
set that some Honeywell mainframes use (6 of these fit in a 36-bit word,
giving 6-char monocase externals, but that is another story). Reading on,
I determined that the author was discussing packed decimal.

The Bell labs GCOS C compiler (and the B language, C's ancestor) have the
construct `abcdef` to generate a BCD character constant, up to six characters.
The 'printf' in the B library has a %b format which prints strings of BCD
characters.

So the question arises: Does a '%b' format mean:
Packed decimal
BCD character set (or another alternative set, as appropriate)
Binary (base 2)
   ?
               Kevin Martin, UofW Software Development Group



More information about the Comp.lang.c mailing list