poor typingWhat is the relationship between numx and x?
if you have a word var say numx
and numx =4095
then 50*numx/100 the result is 81
the word var causes a intermediate stage overflow (bits 0-15 of 204750 =8142)
I still say integer math is tricky and results need to be double checked
intermediate overflow
50*4095 =204750 max value for word 65535 therefore an overflow occurs and the result becomes 8142
Bookmarks