Re: FN-FORUM: ASP Maths Problem!
date posted 1st February 2008 11:16
On Friday 01 February 2008 12:40:26 Rob Colton wrote:
> Not sure I understand, isn't it just
>
>
Close enough for jazz, but for an *accurate* result you need to use
integers only, because (in general) *binary* computers don't store
*decimal* fractions precisely.
Not a real issue in this case, but it can be one of those "gotchas"
that crops up in other problems, so it's a good idea to get in the
habit of doing integer arithmetic wherever possible, and simplifying
the equation to reduce rounding errors (and save CPU cycles, cos
you should).
So intTotal * 47/200 will do nicely.