Path: utzoo!attcan!uunet!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!mimsy!chris
From: chris@mimsy.umd.edu (Chris Torek)
Newsgroups: comp.lang.c
Subject: Re: binary constants (??)
Keywords: macro, constant, binary
Message-ID: <20989@mimsy.umd.edu>
Date: 29 Nov 89 06:29:47 GMT
References: <305@frf.omron.co.jp> <20830@mimsy.umd.edu>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 20
In article <20830@mimsy.umd.edu> I wrote:
>... This would be useful for obfuscation such as
> #(3+#(2,#(6,13)-0010),#(5,11)/30)
>which is actually 1. (I think.)
Too much obfuscation; it comes out to 0.2, which truncates (integer
arithmetic) to 0. That should have been #(5,110) in there.
Anyway, while specific syntaxes for specific bases (8 and 16, and
perhaps 0b for 2 as well, in addition to the `plain' base 10) are
all well and good, it is often better to get rid of specifics and
move toward abstracts. Those of you who are trying to design `D'
(or `P') might consider dumping 0-octal and 0x-hex in favour of
something sane, like r, 2r11001 = 8r31 = 25 = 16r19.
Or for the mathematically TeXish, perhaps _: 11001_2 =
31_8 = 25 = 19_16 = 0p_36. (Of course in TeX one has to write
19_{16}....)
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris@cs.umd.edu Path: uunet!mimsy!chris