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

Re^2: 02.5 == 25 - WTF?

by Eily (Monsignor)
on Nov 30, 2020 at 23:21 UTC ( [id://11124426]=note: print w/replies, xml ) Need Help??


in reply to Re: 02.5 == 25 - WTF?
in thread 02.5 == 25 - WTF?

Both operators work though.

say '==' if 02.5 == 25; say 'eq' if 02.5 eq 25;
prints both == and eq (not that it's surprising either, given perl's seemless conversion between strings and numbers)

Replies are listed 'Best First'.
Re^3: 02.5 == 25 - WTF?
by syphilis (Archbishop) on Nov 30, 2020 at 23:54 UTC
    prints both == and eq

    Yes - though making assumptions about equivalence based on the output of perl's print() function is not a good practice.
    For example:
    C:\>perl -le "print sqrt(2);" 1.4142135623731 C:\>perl -le "print 'WTF' unless sqrt(2) == 1.4142135623731;" WTF
    Cheers,
    Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-19 16:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found