I see this article and at the bottom, it says that modulus operators are expensive so they implemented a slightly faster version of Euclidean Algorithm. Why not make a more efficient mod?
int mod(int a, int b) { // computes a % b;
return (a - b * (a / b));
}