in reply to Re: eq vs ==
in thread eq vs ==

please note that this is not a perl problem, all languages suffer from these same problems. see Java double traps as an example.

Replies are listed 'Best First'.
Re^3: eq vs ==
by Anonymous Monk on Nov 10, 2009 at 21:16 UTC
    This is a language implementation problem. Some languages are lucky enough in their specifications to be able to handle infinitely long numbers and use ratios rather than floats.
      To use ratios alternatively to floats is a good idea, but not every number is a rational number, and "handling infinitely long numbers" would imply infinite memory!

      Shouldn't be too difficult to implement this behavior via overload in Perl just like BigInt, I'm even sure it has already been done on CPAN.

      Cheers Rolf