binary constants (??)

Henry Spencer henry at utzoo.uucp
Thu Nov 30 03:49:13 AEST 1989


In article <20989 at mimsy.umd.edu> chris at mimsy.umd.edu (Chris Torek) writes:
>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 <base>r<text>, 2r11001 = 8r31 = 25 = 16r19.

For some reason, I've never had cause to write numbers in (say) base 19.
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?)
-- 
That's not a joke, that's      |     Henry Spencer at U of Toronto Zoology
NASA.  -Nick Szabo             | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list