Numeric literals in other than base 10 - was Annoying octal notation
Mensanator
mensanator at aol.com
Fri Aug 28 01:19:26 CEST 2009
On Aug 27, 2:26 pm, Piet van Oostrum <p... at cs.uu.nl> wrote:
> >>>>> Mensanator <mensana... at aol.com> (M) wrote:
> >M> On Aug 26, 4:59 pm, Piet van Oostrum <p... at cs.uu.nl> wrote:
> >>> >>>>> Mensanator <mensana... at aol.com> (M) wrote:
> >>> >M> That's my point. Since the common usage of "binary" is for
> >>> >M> Standard Positional Number System of Radix 2, it follows
> >>> >M> that "unary" is the common usage for Standard Positional
> >>> >M> Number System of Radix 1. That's VERY confusing since such
> >>> >M> a system is undefined. Remember, common usage does not
> >>> >M> necessarily properly define things. Saying simply "unary"
> >>> >M> sounds like you're extending common usage beyond its proper
> >>> >M> boundaries.
>
> >>> But the customary meaning of `unary' is the tally system, as a radix
> >>> system wouldn't make sense. I don't know when this term came into use
> >>> but I have known it for a long time.
> >M> Ok, I'll accept that and in the same breath say such common usage
> >M> is stupid. I, for one, have never heard such usage and would never
> >M> use "unary" in the same breath as "decimal, octal, binary" even if
> >M> I had.
>
> As I see it, unary just means that there is one symbol. Binary just
> means that there are two symbols, etc.
Right, and neither word, by itself, gives the full meaning.
>
> With unary, the only sensible numerical interpretation is to count the
> number of occurrences of that symbol, or if you also want to have the
> number 0, the number of occurrences - 1.
Trouble is, nothing's stopping you from making a non-sensible
interpretation.
>
> With binary and higher you can come up with more numerical
> interpretations but the most efficient one is the radix interpretation
> (for different values of `efficient'). I doubt that there are many other
> interpretations that you can call sensible.
But not impossible. You could have a base-3 tally system for ticking
off how many cars on a three lane road pass a given point. And you can
have mixed radix systems (pounds, shillings, pence or degrees, minutes
seconds).
> Therefore we immediately
> think of a radix system when we talk about binary, octal, decimal etc.
> But the word `binary' itself doesn't imply that.
Just as unary doesn't imply that it's an extension of binary made by
simply changing the base because there's more to it than that.
Yet, I constantly run into people who get confused by this. As a
result, I will never use the word "unary" even if it is considered
acceptable. If I'm trying to imply some sort of base-1 system,
I'll explain what I'm talking about and not assume the listener
will fully understand what is meant by "unary".
> --
> Piet van Oostrum <p... at cs.uu.nl>
> URL:http://pietvanoostrum.com[PGP 8DAE142BE17999C4]
> Private email: p... at vanoostrum.org
More information about the Python-list
mailing list