Hmm, very interesting.

So are you saying that I should never use floats (if so why are the even a data 
type)? I've used them in SQL server DBs in the past and never had this problem, 
is this just down to MySQL?

Cheers

>> I have recently found a bizarre situation where numbers are not
>calculating correctly when the values are stored in FLOAT data types.
>
>This is not just a database-related issue - it's found in computer
>systems in general.
>
>Floating point numbers are by definition approximations. This often
>surprises people. As you suggested, the DECIMAL type is provided by
>many DBMS to get around exactly this problem. DECIMAL numbers are not
>approximations. They take up much more space to represent very large
>or very small numbers and aren't directly supported in hardware, so
>they are less efficient.
>
>Nick

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240851
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to