Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^6: Definition of numerically equal and rationale for 'you' == 'me'

by lutok (Scribe)
on Mar 05, 2012 at 23:54 UTC ( #957997=note: print w/replies, xml ) Need Help??


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

I'm coming in a little late, but this is what I got on Mac Lion, perl-5.14.2:

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

strange

Update: Oh I see ... 'nan'...'inf'

  • Comment on Re^6: Definition of numerically equal and rationale for 'you' == 'me'
  • Download Code

Replies are listed 'Best First'.
Re^7: Definition of numerically equal and rationale for 'you' == 'me'
by ikegami (Pope) on Mar 06, 2012 at 08:13 UTC

    Could you give me the output of the following, please?

    perl -le'print "foo" == 0 ? "as per docs" : "deviates from docs"'

    perldata:

    strings that aren't numbers count as 0, just as they do in awk

      You missed the update :)

      $ perl -le " print int $_ for qw/ na nan nanners in inf infant /" 0 -1.#IND -1.#IND 0 1.#INF 1.#INF

      perlop mentions NaN, while bigint...

        Saw the update later. I get it, thanks :)

        I didn't miss it, I misunderstood it. I thought you meant it was returning NaN for all strings, not just those starting with "nan".

        That's rather weird, but it is consistent with "123abc".

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://957997]
help
Chatterbox?
choroba has a small USB lamp
[ww]: ++ all (phony labels re "gaming"
[1nickt]: ambrus perhaps you know where the keys are?
[ww]: OTOH, -- for ads suggesting that being good at games is somehow eq "greatness"
[ambrus]: 1nickg: obviously the gamers don't know. but anyway, I need the whole room backlit, because watching a monitor in a dark room (like many people do) is tiring for my eyes, even more so than doing it in a lit room.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (14)
As of 2017-03-27 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.