Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!amdahl!ptsfa!well!physh From: physh@well.UUCP (JonPhysh Foreman) Newsgroups: comp.lang.c,net.sources Subject: Re: binary radix (+ some source) Message-ID: <2924@well.UUCP> Date: Wed, 22-Apr-87 08:05:25 EST Article-I.D.: well.2924 Posted: Wed Apr 22 08:05:25 1987 Date-Received: Fri, 24-Apr-87 01:14:08 EST References: <213@pyuxe.UUCP> <710@brl-sem.ARPA> <422@ivax.doc.ic.ac.uk> <2970@pegasus.UUCP> <581@csun.UUCP> Reply-To: physh@well.UUCP (JonPhysh Foreman) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 39 Keywords: octal, hex, binary, roman Summary: Why just binary? Xref: mnetor comp.lang.c:1848 net.sources:4352 I had a hack in a C compiler for 4.1 BSD (which went away as well as the source for 4.3 BSD) which would accept 0R So that it would be valid to say: pagenumber = 0rvii; /* pagenumber = 7 */ etc. At the same time I also added a special routine which would take 0f.. The "f" is "fix radix", base is the number base to use, and number is the number in "base" base. So: 0f12.10 = 12 (decimal) 0f0x10.10 = 0f16.10 = 16(decimal) /*note imbedded reference 0x..*/ 0f2.10 = 2 (decimal) and "0f18." would consist of the set of { 0123456789abcdefgh } digits. Note, this method only worked up to base 36. I forget what I did with "0f0." and "0f1.". This could get really complicated quickly, but think how good it would do for the C obfustication awards! I don't think I ever implemented printf & scanf functions to deal with this kind of tripe. Jon ------------------------------- Disclaimer: Today, I'm probably insane (or at least I'll plead it that way), who knows about tomorrow. Addresses .. ucbvax!dual!unicom!physh .. hplabs!well!physh .. killer!ssbn!physh