[TriLUG] Money in mysql
Phillip Rhodes
mindcrime at cpphacker.co.uk
Thu Oct 14 05:54:54 EDT 2004
Following up on my own last message, here is a link
to a paper titled "What Every Computer Scientist
Should Know About Floating-Point Arithmetic." It's
something someone on the JUG list pointed out to me
a while back. It's very deep, possibly more so than
needed by the average programmer. But at least it serves
as a good reference on the subject, and contains info
on the IEEE standard I was referring to before.
If nothing else, it would probably be important to
know whether your chosen environment (langauge / hardware )
conforms to that spec or not... if it does, then at least
you'll know you have a certain level of guaranteed behavior
you can depend on.
And again, some languages may take care of this for
you by providing a special datatype for currency. Which
of course leads back to the original question of which
type of field to store those values in. Dang, guess
I haven't been much help at all. :-)
http://docs.sun.com/source/806-3568/ncg_goldberg.html
TTYL,
Phil
More information about the TriLUG
mailing list