Commit f2ef7136 authored by Simon Lindholm's avatar Simon Lindholm

Optimize FastMod slightly

parent 390bc162
......@@ -18,6 +18,6 @@ struct FastMod {
FastMod(ull b) : b(b), m(ull((L(1) << 64) / b)) {}
ull reduce(ull a) {
ull q = (ull)((L(m) * a) >> 64), r = a - q * b;
return r >= b ? r - b : r;
return r - (r >= b) * b;
}
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment