Re: Numeric literals in other than base 10 - was Annoying octal notation
- From: Mensanator <mensanator@xxxxxxx>
- Date: Mon, 24 Aug 2009 22:27:51 -0700 (PDT)
On Aug 24, 8:21�pm, Mel <mwil...@xxxxxxxxxxxx> wrote:
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.
Not really. If your single digit is one, you still have
an infinitely long representation only instead of every
position being zero, every position is one.
So either the only number that can be represented is 0,
or the only number that can be represented is infinity.
No amount of tweaking can fix this.
So, to use radix 1, you have to abandon the concept
of "Standard" (contains a 0) AND abandon "Positional"
(infinitely long representation). It's all in TAOCP
by Knuth if you want to get it straight.
You can have a radix 1 number system, but is meaningless
to speak of "unary" in the same context as hex, decimal,
octal & binary.
� � � � Mel.
.
- References:
- Re: Annoying octal notation
- From: Derek Martin
- Re: Annoying octal notation
- From: James Harris
- Re: Annoying octal notation
- From: David
- Re: Numeric literals in other than base 10 - was Annoying octal notation
- From: Max Erickson
- Re: Numeric literals in other than base 10 - was Annoying octal notation
- From: James Harris
- Re: Numeric literals in other than base 10 - was Annoying octal notation
- From: Mel
- Re: Numeric literals in other than base 10 - was Annoying octal notation
- From: James Harris
- Re: Numeric literals in other than base 10 - was Annoying octal notation
- From: Steven D'Aprano
- Re: Numeric literals in other than base 10 - was Annoying octal notation
- From: Mensanator
- Re: Numeric literals in other than base 10 - was Annoying octal notation
- From: Mel
- Re: Annoying octal notation
- Prev by Date: Re: [ANN] pyxser-1.2r --- Python-Object to XML serialization module
- Next by Date: Re: your favorite debugging tool?
- Previous by thread: Re: Numeric literals in other than base 10 - was Annoying octal notation
- Next by thread: Re: Numeric literals in other than base 10 - was Annoying octal notation
- Index(es):
Relevant Pages
|
Loading