Re: fractional cents

"A. Pagaltzis" <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <20040424144309.GB805@klangraum>
* Keith C. Ivey <[email protected]> [2004-04-22 14:48]:
> Math won't work, because floats aren't exact.

Actually, that is a point I meant to make somewhere in this
thread.

When you're dealing with money, it's better to use cents (or
tenths or hundredths of cents) as a unit, rather than dollars.
You can then use integer math. This gets you around all the
problems with a base-2 representation of base-10 fractions,
something you don't want to have to deal with when money is on
the line..

-- 
Regards,
Aristotle
 
"If you can't laugh at yourself, you don't take life seriously enough."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.