in reply to Re: Determining whether a value is zero.
in thread Determining whether a value is zero.

Any definition that deems "0" as zero, but "00", "0.0" & "0 " as not, is so arbitrary
Please, take that up with Larry Wall. It isn't my fault that he considered "0" to be false, but "00", "0.0" & "0 " to be true. But then, that guy is well known for his arbitrary decisions which he never entertains any argument with, rendering the entire Perl language pointless.
  • Comment on Re^2: Determining whether a value is zero.

Replies are listed 'Best First'.
Re^3: Determining whether a value is zero.
by BrowserUk (Patriarch) on Mar 10, 2011 at 13:55 UTC
    he considered "0" to be false,

    That's not quite the same things as considering '00' to be non-zero is it!

    C:\test>perl -e"print '00' == 0" 1

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      That's not quite the same things as considering '00' to be non-zero is it!
      No, but you were complaining about the arbitraryness. It has the same arbitraryness as for true/false.
      C:\test>perl -e"print '00' == 0" 1
      So what?
      $ perl -E 'say "BrowserUK" == 0' 1 $ perl -E 'say "00" eq 0' $
      Heh, I made the challenge, I make the rules. If you don't like the rules, don't play.
Re^3: Determining whether a value is zero.
by Argel (Prior) on Mar 11, 2011 at 01:10 UTC
    Certainly is interesting that quoted 00 is true while quoted 0 is false (but it sounds like '0', "0" are special cases).
    perl -E 'say 0 ? q{true} : q{false}' # false perl -E 'say 00 ? q{true} : q{false}' # false perl -E 'say q{0} ? q{true} : q{false}' # false perl -E 'say qq{0} ? q{true} : q{false}' # false perl -E 'say q{00} ? q{true} : q{false}' # true perl -E 'say qq{00} ? q{true} : q{false}' # true
    Perl 5.10.1 on Solaris 10 SPARC.

    Elda Taluta; Sarks Sark; Ark Arks