Re: Rounding Problem


[ Follow Ups ] [ Post Followup ] [ CS1044 Web Discussion Board ] [ FAQ ]

Posted by William D McQuain on October 04, 2001 at 10:33:29:

In Reply to: Rounding Problem posted by Nitin Khanna on October 04, 2001 at 09:42:38:

: For my output, I'm getting the following:

: State tax 0.21
: ============================================
: Total 60.02

: The state tax for this input file is suppose to be .20 and the total 60.01 but the state tax is messing up the total since it's being added. Any idea's on how to fix this problem?

First, you've probably missed something in the specification regarding the state tax.

Second, if you're using doubles instead of ints you may be running into a numerical issue that can only be fixed (easily) by using ints.




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS1044 Web Discussion Board ] [ FAQ ]