in reply to Re: Strange (rounding?) problem
in thread Strange (rounding?) problem

I believe what you are trying to say is:

print "The numbers $foo and $bar are significant different!" if (abs($foo - $bar) >= (10**-10));

Note the difference in the equality sign. : )

Replies are listed 'Best First'.
Re: Re: Re: Strange (rounding?) problem
by iakobski (Pilgrim) on May 02, 2001 at 14:48 UTC
    The problem with this is that you have to know a priori what the range of your numbers is.

    suppose $foo = 1e-11 and $bar = 2e-11 your method will say they are not significantly different.

    Suppose $foo = 1.1e54 and $bar = 1.1e54 then you would want to say that they are not different, but it is quite possible that a stray bit would cause your method to say that they are different.

    iakobski