Huh, you know. Now that I'm not at work and therefore don't have my numbers to check against, you're right.

Man, I must need more coffee.

Never mind me. :)

May be back tomorrow, though, when I have the numbers in front of me. I know they didn't add up earlier...

Martin

Hassan Schroeder wrote:
Martin wrote:

My recent test involved the following three values from the column:
2.4950
2.5950
2.7700


When I use a SUM() on these I get: 7.860


Sounds good to me...

If I switch the column over to a FLOAT, then the SUM() becomes 7.8599998950958

Using Excel to test the numbers, or hand-calculating, I get:
7.8550.


Time for a hand upgrade, I think :-)  5 + 5 = 5???  I don't even
want to think about how Excel would come up with this...

Shouldn't the SUM() remain with the precision of the DECIMAL type and not try to round to 2 decimal places?


My own, possibly suspect, hand calculations show that SUM() is right;
and it's common knowledge that floating point isn't the right thing to use for situations like this -- that's why there *is* a DECIMAL type.


FWIW!

-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to