in reply to Re: Definition of numerically equal and rationale for 'you' == 'me'
in thread Definition of numerically equal and rationale for 'you' == 'me'

Move right character by character

As already noted, it's not actually done "character by character".
If it were done that way 'nanosecond' == 'nanosecond' and 'informal' == 'formal' would both be true.
Most places they're both false - though it generally depends upon the underlying libc (and, in some cases, perl bugginess).

Cheers,
Rob

Replies are listed 'Best First'.
Re^3: Definition of numerically equal and rationale for 'you' == 'me'
by ikegami (Patriarch) on Mar 02, 2012 at 05:00 UTC

    As already noted, it's not actually done "character by character".

    No, it was (correctly) said that skipping the leading non-number part isn't done at all.

    If it were done that way 'nanosecond' == 'nanosecond' and 'informal' == 'formal' would both be true.

    They are both true even though it's not done that way, so that's a useless statement.

      They are both true

      Where are they both true ?
      Did you even bother testing it ?

      Quite frankly, I regard it as an insult that you so quickly assume I'm just another moron.

      On Windows, perl-5.14.0:
      C:\>perl -e "print \"true\" if 'nanosecond'== 'nanosecond'" C:\>perl -e "print \"true\" if 'nanosecond'!= 'nanosecond'" true C:\>perl -e "print \"true\" if 'informal'== 'formal'" C:\>perl -e "print \"true\" if 'informal'!= 'formal'" true C:\>
      Should be the same most places.

      Rob

        I get exactly the opposite results under 5.8.8 and 5.8.9, hpux, msys, and windows. One such example:

        $ perl -e "print \"true\" if 'informal'== 'formal'" true

        Update: Under strawberry 5.14.2 MSWin32-x86-multi-thread, the results are different:

        $ /c/perl/strawberry/perl/bin/perl -e "print \"true\" if 'informal'!= +'formal'" true $ /c/perl/strawberry/perl/bin/perl -e "print \"true\" if 'informal'== +'formal'"

        Update: Ahhhh! Very sneaky :-).

        --MidLifeXis

        Yes, even though I knew the result, I did test. I even used 5.14.0 on Windows like you. (ActivePerl build 1400, to be specific.)

        >perl -e "print \"true\" if 'nanosecond'== 'nanosecond'" true >perl -e "print \"true\" if 'nanosecond'!= 'nanosecond'" >perl -e "print \"true\" if 'informal'== 'formal'" true >perl -e "print \"true\" if 'informal'!= 'formal'" >

        'nanosecond', 'informal' and 'formal' are all numerically equal to zero, so your build is very buggy.