R
Roedy Green
If you use double to compute sales taxes, and round to the nearest
penny, there is a gotcha. You are supposed to round a precise half
penny up. This won't work properly for percentage like 6% (0.06) (of
$0.75) which is not precise in binary.
There a number of ways to avoid problem. Which would you use?
penny, there is a gotcha. You are supposed to round a precise half
penny up. This won't work properly for percentage like 6% (0.06) (of
$0.75) which is not precise in binary.
There a number of ways to avoid problem. Which would you use?