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



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.

.



Relevant Pages

  • Re: #400 multiplication again and a better Place Value Notation; new textbook: "Mathematical-Phy
    ... mathpeople don't use infinity, at all, ... you add one to this representation of "minus one," ... Saying that the 1 digit of 100...000 is in the 100...000 ... of the vanishingly small spherical trigon ...
    (sci.math)
  • Re: How to convert a number to hex number?
    ... Originally two's compliment representations were used to efficiently ... the same could be said for any ascii representation of numbers. ... The idea of base-complement is that the first digit is the zero digit for ... Also I wanted to see how much slower using strings instead of ints would be. ...
    (comp.lang.python)
  • Re: String of digits, certain radix, perform division
    ... The radix is 13. ... The most significant digit is on the left. ... my function, I get the radix, the digit array, and a pointer to ... The divisor is held in a normal integer type (not as a string ...
    (comp.lang.c)
  • Re: F08 support of floating decimal?
    ... I don't look forward to decimal float. ... literal is converted to a binary floating point representation is ... one prefers a radix with as many factors as ... has no exact representation (because twelve does not contain a factor ...
    (comp.lang.fortran)
  • Re: algorithms + data structures = programs
    ... Richard Heathfield wrote: ... Yes, okay, I agree. ... And dis the digit that will be displayed at ... Wirth ex machina again - he presumes the last digit of the representation ...
    (comp.programming)

Loading