MySQL Forums
Forum List  »  General

Re: Sum of doubles giving incorrect value
Posted by: Peter Brawley
Date: January 04, 2011 01:37PM

Quote

I know it's almost 0, but that's gotta be a bug, right?

Wrong. Floating point numbers have rounding errors, so should never be used where exactness is required.

Use DECIMAL.

PB

Options: ReplyQuote


Subject
Written By
Posted
Re: Sum of doubles giving incorrect value
January 04, 2011 01:37PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.