its mainly about speed of execution and code size.
eg miles to kilometre conversion k=m*1.609
pbp has no floats so the 1.609 needs to be scaled up and then the result scaled back
this will work :-
you could do 1.609*1000=1609
k=m*1609 /1000
(k=m*1609
div32 1000)
this is better :-
using 1.609 * 256 = 411
so k=m*411/256 (eq to k=m*/411)
and will give you smaller faster code
and has a larger input range before overflowing also
Bookmarks