While I’ve known how floating points are stored, I didn’t know if decimal was stored any differently, or if it was more or less accurate. According to a post on the MySQL list:
Bruno Rodrigues Silva wrote:
> Dear all.
>
> The MySQL Manual inform that Decimal Data Type is used
> for represent exact-number, but like Float Point Data
> Type, Decimal use rounding case the fractional part is
> not sufficient. Therefore, what the difference?
Hi Bruno,
FLOAT rounds as floating point and DECIMAL rounds as you would
expect it
to. Floating point arithmetic is not exact and that’s why they’ve
called
DECIMAL an “exact packed decimal number” because apparently you
can rely
on it’s roundings.
The primary use for DECIMAL is money, where floating point would
fail
…