If you use eq instead of == it yields the correct result :
#!/usr/bin/perl use strict; use warnings; my $x1 = 44.7; my $x2 = 44.9-0.2; print "numbers $x1 $x2 - "; if ($x1 eq $x2) { print "SAME\n"; } else { print "NOT SAME\n"; }
.. but I'm not sure as why it is so !?
In reply to Re: perl numeric expressions
by secret
in thread perl numeric expressions
by deckard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |