3 ms·
A small gotcha you didn't mention: if you work modulo 2 and 3, then your results are only valid modulo 6 (generally, the product of your moduli). Unless you're
by klyrs 5y ago
A small gotcha you didn't mention: if you work modulo 2 and 3, then your results are only valid modulo 6 (generally, the product of your moduli).
Unless you're happy with the assertion that 15*14==0, that is. I don't judge.
- FartyMcFarter 5y agoIf you know that you're working with numbers as big as 15 and 14, you could alternatively use more residues so that you can represent those numbers. If you don't know how big the numbers get, then you do run into the issue I mentioned of overflow detection being expensive.