in reply to Odd results from mixing integer and floating point math?

Could you post the exact code, please? It's a bit unclear why you end up with a result of 1451.98726786648 while your formulate indicates a simple $d - $e. In short, or 1451.98726786648 is a typo or $f = $d - $e is...
  • Comment on Re: Odd results from mixing integer and floating point math?

Replies are listed 'Best First'.
Re^2: Odd results from mixing integer and floating point math?
by punch_card_don (Curate) on Aug 21, 2005 at 17:12 UTC
    Aie! Sometimes you just need someone else to say what you should already know. The result is so ridiculous that, yes, of course, it's a typo in the script. Had inadvertently subtracted $e from the wrong variable. That's what I get for coding on Sundays. Thanks.

    Forget that fear of gravity,
    Get a little savagery in your life.

      Would that not have been caught by use strict?

      --

      Oh Lord, won’t you burn me a Knoppix CD ?
      My friends all rate Windows, I must disagree.
      Your powers of persuasion will set them all free,
      So oh Lord, won’t you burn me a Knoppix CD ?
      (Missquoting Janis Joplin)

        Umm...  no, because use strict; does not catch logic errors of this sort (or any sort, afaik).