in reply to Re: Comparing numbers
in thread Comparing numbers

What's the point of using -w and use warnings? And why quote numbers? Also, your code seems to fail if all numbers are equal - it won't generate output.

Abigail

Replies are listed 'Best First'.
Re: Re: Comparing numbers
by Chief of Chaos (Friar) on Nov 29, 2002 at 11:28 UTC
    ok, -w and use warnings don't make sense.
    Yes, you are correct with the equal - output and the numbers.
    change
    my @file = ('0.13','0.14','0.14'); my $diff = 0;
    to
    my @file = (0.14,0.14); my $diff = -1;
    and here you got your output
    Difference between 0.14 and 0.14 is 0