in reply to perl numeric expressions
Use a fixed number of decimal places on your comparrison
for more help see this tutorial
This is not a Signature...
if (sprintf("%.1f", $x1) == sprintf("%.1f",$x2)) { print "SAME\n"; } else { print "NOT SAME\n"; }
for more help see this tutorial
This is not a Signature...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: perl numeric expressions
by deckard (Initiate) on Nov 28, 2005 at 13:34 UTC |
In Section
Seekers of Perl Wisdom