Numeric literals in other than base 10 - was Annoying octal notation

Mel mwilson at
Tue Aug 25 03:21:32 CEST 2009

Mensanator wrote:
[ ... ]
>> If you want your data file to have values entered in hex, or oct, or even
>> unary (1=one, 11=two, 111=three, 1111=four...) you can.
> Unary? I think you'll find that Standard Positional Number
> Systems are not defined for radix 1.

It has to be tweaked.  If the only digit you have is 0 then your numbers 
take the form

0*1 + 0*1**2 + 0*1**3 ...

and every number has an infinitely long representation.  If you cheat and 
take a 1 digit instead then it becomes workable.


More information about the Python-list mailing list