Andy Wardley abw at
Tue Feb 26 10:24:23 GMT 2008

Dan Rowles wrote:
> I have encountered some weirdness with floating point numbers, and I was 
> hoping for your collective wisdom on what to do next.

That's just the way floating point numbers work.  Epsilon is your friend:

   use constant epsilon => 0.0000001;      # a suitably small number

   sub fp_equal {
      abs($_[0] - $_[1]) < epsilon;


More information about the mailing list