Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!husc6!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: binary constants (??) Message-ID: <15348@haddock.ima.isc.com> Date: 4 Dec 89 22:41:59 GMT References: <305@frf.omron.co.jp> <20830@mimsy.umd.edu> <20989@mimsy.umd.edu> <1989Nov29.164913.1794@utzoo.uucp> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 20 In article <1989Nov29.164913.1794@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >For some reason, I've never had cause to write numbers in (say) base 19. Interestingly enough, I once needed to write some constants whose natural radix was 64 (and, due to the context, none of the radix-64 digits would ever exceed the value of 'Z'). When I tried to make use of the arbitrary-radix feature built into the language I was using at the time (using the notation ddddB64), it triggered a compiler bug. >I wonder if the added generality really buys you anything, given that it >does introduce a new class of subtle errors. (How many programs would >notice if 16r19 was mistyped as 15r19? Or 19r16?) It doesn't seem any worse than the problem of accidentally putting a leading zero on a number intended to be decimal. Anyway, a partial solution is to have the compiler optionally warn about the use of an "obscure" radix. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint (Bonus question: identify the language, operating system, and university where I had use for radix 64. No, I *don't* mean radix 40 aka RAD50.)