>if we divide 5 you will only get 2 but not 2.5
Try to make the code so it will work with div/mult by 2/4/8/16
and you or the compiler will use right/left shift.
if you use numbers like *3 or *5 the compiler will most likely still just use 1 or 2 left shifts + original value.
div by 5, as integer don't have decimal point the result will be floored.
if you need decimal point, 32bit fixed point by Union could do it.
Code:
union{
unsigned long myfixvar;
struct{
unsigned int myfixlow;
unsigned int myfixhigh;
}
}