in reply to Re: Instructive bug
in thread Instructive bug

You have the right idea. I actually got floats earlier than the 32-bit barrier though. Can anyone other than mpeppler guess why?

And for perrin, what I did about it was put in a slight fudge factor to handle small roundoffs, and on the inner loop I put a fatal check for overrunning the balances array in case the hack failed. I have had no problems since.

Replies are listed 'Best First'.
Re: Re (tilly) 2: Instructive bug
by ChemBoy (Priest) on Mar 05, 2002 at 18:19 UTC
    Well, it seems rather as if you were dealing with money here, in which case I imagine that you started out with floating-point values, no?



    If God had meant us to fly, he would *never* have given us the railroads.
        --Michael Flanders

Re: Re (tilly) 2: Instructive bug
by mdillon (Priest) on Mar 05, 2002 at 17:48 UTC
    The division will cause a floating point coversion, I believe.
      And when dealing with money they arise before that because...?
        The input is floating point (at least in plain Perl without using Math::FixedPrecision or something). Heh.