Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site watmath.UUCP Path: utzoo!linus!decvax!watmath!kpmartin From: kpmartin@watmath.UUCP (Kevin Martin) Newsgroups: net.lang.c Subject: Re: C needs BCD (ANSI People: Please Lis Message-ID: <9772@watmath.UUCP> Date: Thu, 8-Nov-84 21:18:25 EST Article-I.D.: watmath.9772 Posted: Thu Nov 8 21:18:25 1984 Date-Received: Sat, 10-Nov-84 05:14:09 EST References: <106@ISM780B.UUCP> <273@cubsvax.UUCP> Reply-To: kpmartin@watmath.UUCP (Kevin Martin) Organization: U of Waterloo, Ontario Lines: 22 >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