Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

0 is both a digit and a number (which I will call "zero" for the rest of this post to make this clearer), and I think it's important to keep that distinction in mind.

Zero can be represented in a variety of ways, including as "0". It could equally well be represented as "2-2", or "e+1", and so on; the number's the same, it's just written a different way. (Compare how "0.999..." denotes the same number as "1"; it's merely two different ways of writing down the same thing.)

"42" vs. "042" vs "0...042" with any arbitrary number of leading 0s is an example of the same. That's the digit 0 there, not the number zero; the number is the same (and canonically written as just "42", although that's just convention).

Indeed, for another example, compare different bases. 0x2A (hexadecimal) is the same as 42 (decimal) as 052 (octal) as 101010 (binary). Different representations again, but they are all names for the same number.

So that said:

I agree, but what is then consequently the meaning of the empty string in base n with n > 0 ?

The meaning of the empty string in base 1 is the number zero -- but not the digit 0, though that digit, on its own and interpreted in bases n≥2, represents the number zero. The meaning of the empty string in such higher bases isn't generally agreed on, I think (by which I mean that nobody asked me for my opinion on the matter ;)). Consider this: you can tell me what "2+3*4" is, but if I asked you about "2+*4", you'd say that that's not a valid calculation, rather than giving the answer as "2" after having interpreted the empty string between the "+" and "*" as the number zero.

Lets talk about base 0 now ;)

Hmm, base 0? Talk about weird! Since 00=1 by usual convention, but 0n=0 for any other n, you couldn't represent any number larger than one. But that'd be the least of your problems, since your set of symbols (read: digits) would be empty anyway, and you could not actually represent anything other than the number zero, which would be represented by the empty string.

In reply to Re^3: In base 1, the number after 0 is: by AppleFritter
in thread In base 1, the number after 0 is: by chacham

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (10)
    As of 2019-12-10 22:02 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found