Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: NaNs are true (NaN == 0 -> true? Really?)

by BrowserUk (Pope)
on Feb 27, 2011 at 12:11 UTC ( #890401=note: print w/ replies, xml ) Need Help??


in reply to Re^3: NaNs are true (NaN == 0 -> true? Really?)
in thread NaNs are true

I think all of those are correct, though not particularly useful. They should also prompt (at least) a warning, though I think a catchable exception is better.

You also have to be careful to distinguish between a variable containing NaN, and a constant NaN I think.

That is, I think the only time any comparison involving a variable containg NaN should result in a true value, is if it is compared against a predefined constant NaN; were one to be provided. Though an isNaN( $x ) function or equivalenly $x->isNan() method would serve the same purpose and be less likely to confuse.


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.


Comment on Re^4: NaNs are true (NaN == 0 -> true? Really?)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://890401]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-12-27 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls