Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^6: Why is Zero not 0?

by lodin (Hermit)
on Feb 07, 2008 at 02:18 UTC ( [id://666716]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Why is Zero not 0?
in thread Why is Zero not 0?

Did you get the + and - swapped? Now comp(5, 4.5, 1) is false and comp(5, 4.5, -1) is true.

Personally I prefer to use the good old standard mathematical way of expressing it:

if (abs($x - $y) <= $tolerance) { print "$x and $y are 'equal'"; }

lodin

Replies are listed 'Best First'.
Re^7: Why is Zero not 0?
by Joost (Canon) on Feb 07, 2008 at 11:50 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found