$x = 1742-1e-12; $y = 0; $z = 1742; print "$x + $y >= $z is ", ( $x + $y >= $z ? 'true' : 'false', "\n"; __END__ 1742 + 0 >= 1742 is false #### sub round { my $number = shift; my $precision = shift || 0; # optional precision my $template = "%.${precision}f"; return sprintf $template, $number; } $x = round( 1742-1e-12 ); $y = round( 0 ); $z = round( 1742 ); print "$x + $y >= $z is ", ( $x + $y >= $z ? 'true' : 'false', "\n"; __END__ 1742 + 0 >= 1742 is true