HankMcSpank,
I suspect you are expecting to see a rounded final value when in fact your final value is truncated.
1960/500,000 = 255.102, PBP truncates to 255 (same as rounding)
1961/500,000 = 254.972, PBP truncates to 254 (would round to 255!)
If you add "half of a whole value" before truncating it is the same as rounding. You can't add 0.5 to the DIV32 result because we aren't using floating point. So we add it before the division:
1960/500,500 = 255.488, PBP truncates to 255
1961/500,500 = 255.227, PBP truncates to 255 (all is good)
You've may still have some granularity issues but this should get you closer.
I remember hearing a long while back that "floating point math is for weenies who can't think big." 8^)
Best Regards,
Paul
Bookmarks