3 ms·
Unless your hardware implements BCD arithmetic, this method is pretty much guaranteed to be slower than just applying the MOD directly: Direct calculation: 1 d
by qayxc 6y ago
Unless your hardware implements BCD arithmetic, this method is pretty much guaranteed to be slower than just applying the MOD directly:
Direct calculation: 1 division
Proposed method: 1 division plus 1 bit shift plus 1 addition (per digit) plus 1 intermediate register
finally one division
It doesn't matter whether division is implemented in hardware. On machines with BCD support, benchmarking would be required to see whether this method is beneficial.