Jim Weirich <jweirich / one.net> wrote:
> This is a consequence of representing numbers in floating point and is
> common whenever dealing with floating point numbers.  Last week at work,
> I came across a situation where a sum of monetary amounts were off by a
> penny ... Yes, they were using floating point to represent dollar
> amounts.  Never a good idea.

Well, you can search comp.lang.c about a thread on what type to use
(int/long/double/etc.) to represent dollar amounts (including the
cents).  I don't think there is a clear answer that representing dollar
amounts with floating point is a bad idea.  It depends on what kinds of
operations you are going to do, which in this case is a division.

Regards,

Bill