Hello experts, to avoid a division, I use integer arithmetics. The unsigned int x which is in the range of 2000 is first multiplied by a number s which is 2048 plus/minus 1000 and then shifted by 11 digits which should replace a division by 2048.
unsigned int near x; unsigned int s x = ( (unsigned long) x * (unsigned long) s ) >> 11 ;
Right shifting is not implementation defined if the operand is unsigned. In the signed case the implementor has the choice of either shifting in zero-bits or copies of the leftmost bit (usually the sign bit).