optimized integer divisions with bit shifting