Python Gotcha with Octal Numbers
John W. Baxter
jwbaxter at spamcop.net
Thu Feb 14 10:03:59 EST 2002
In article <a4geh2$hir$12 at bob.news.rcn.net>, <jmfbahciv at aol.com> wrote:
> In article
> <2D484E1BB24678AC.1496996E81BD013F.73A9A3A001BEE345 at lp.airnews.net>,
> claird at starbase.neosoft.com (Cameron Laird) wrote:
> >In article <130220020751360934%jwbaxter at spamcop.net>,
> >John W. Baxter <jwbaxter at spamcop.net> wrote:
> > .
> > .
> > .
> >>Did the elves at AT&T pick up the "leading 0 means octal" from
> >>something earlier, or did they invent this stupidity themselves?
> > .
> > .
> > .
> >OK, folks, how far back *can* we trace this? My
> >mind associates it with DEC systems, going back
> >to the '60s, but I couldn't find any confirmation
> >of that in a quick search.
>
> You will never find a DEC standard that ever defined
> a number with a leading zero to be octal. I never
> typed up anything that ever had that kind of standard.
Well, Digital's hardware was what the AT&T elves worked with, so the
connection is certainly there, but not necessarily coming in from DEC.
I can't remember from my not-extensive messing about with PDP-1 (serial
1, provided at no charge and with support by DEC) at MIT whether that
assembler used a leading 0 to signal octal, or used something else.
[Octal was natural on that machine...hex wasn't an issue.] That
assembler pretty much moved to the PDP-1 from the older TX-0
("Transistorized eXperimental" and the round thing is zero) next door.
And then moved on to DEC along with a bunch of people, who were key
parts of the technical staff for a long time. That was a very fertile
"seeding" by the General. And produced "SpaceWar."
--John
More information about the Python-list
mailing list