On 28 May 2004, at 04:31, Andrew Gaffney wrote:

I am writing a program to parse a CSV file downloaded from my bank. I have it keep a running balance, but I'm getting a weird total. Apparently, -457.16 + 460.93 = 3.76999999999998. But when 20 is subtracted from that, I get -16.23. There are no weird numbers like that in my input data. All numbers have no more than 2 numbers after the decimal point. Here is my code:


Those numbers are correct -457 + 460 does = 3.

It sounds like you're saying you shouldn't have negative numbers in there. or what do you mean by weird. Is it because perl is returning more that 2 digits as the remainder.

Angie


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to