5 ms·
An even trickier way to do this is to rotate right by the power of two factor between doing the multiply and the compare.
by raphlinus 10y ago
An even trickier way to do this is to rotate right by the power of two factor between doing the multiply and the compare.
- im3w1l 10y agoThat wouldn't work, because a number that is bigger than the threshold could become smaller than it after the rotation.