Hacker News new | ask | show | jobs
by rkwasny 3479 days ago
Shouldn't a good compiler apply this type of optimisations?
1 comments

It generally does. (GCC, Clang and ICC) But it cannot simplify the operation on some architectures or when the factor is variable.

The "fastrange" is a very different operation on prime factors than modulo.