Re: fractional cents

Ronald J Kimball <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
On Mon, Apr 26, 2004 at 06:49:52AM +0200, Pense, Joachim wrote:
> A. Pagaltzis [mailto:[email protected]] wrote:
> 
> > 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..
> 
> But then you still have the issue of marking the difference between 257
> cents and 257.0 cents.

Of course.  But that's much better than marking the difference between 2.57
dollars and 2.56999999999999984013 dollars, wouldn't you agree?

Ronald
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.