Hi- This appears to be a rounding / trucation error. So, should we not initially add one to fix this? 00000111 +1 => 00001000 shifted=> 00000001 123: 01111011 => 01111100 => 00001111 10000000 + 00000001 11110000 => 00010000 = 16 123 => 7B +1 => 7C /8 => 0F 80 + 00 18 => 11 70 discard low byte=> 11 = 17! 235 => 33 David Wouter van Ooijen wrote: >>calculate the following expression: >>x >> 3 + x >> 6 >>The error should be less, than 1:448 >> >> > >Probably true in the analog/floating point world, but in the binary >(integer) world 7 / 7 == 1, but 7 >> 3 == 0, so in this particular case >the error is rather large :( > >Wouter van Ooijen > >-- ------------------------------------------- >Van Ooijen Technische Informatica: www.voti.nl >consultancy, development, PICmicro products > >-- >http://www.piclist.com hint: To leave the PICList >mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu