Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: undef == 0?

by swampyankee (Parson)
on Oct 26, 2007 at 00:08 UTC ( [id://647298]=note: print w/replies, xml ) Need Help??


in reply to Re^2: undef == 0?
in thread undef == 0?

It does mean that 1 && 2 evaluates to true. And, were Perl to have Fortran-style logical comparison operators (.EQV. and .NEQV.; this gives me an idea for an Acme module...), 1 eqv 2 would evaluate to true.

Every language has its little corners which may not be that well thought out; undef& == 0 evaluating to true may be one of them (00 evaluating to 1 is probably another). It is consistent, and arguably reasonable, behavior, although it's just as sensible, and arguably more reasonable, to have undef behave like NaN and not be comparable to anything, even itself (NaN == NaN and NaN != NaN are both false in most languages).


emc

Information about American English usage here and here.

Any Northeastern US area jobs? I'm currently unemployed.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-24 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found