I was reading the Modular Multiplication page on wikipedia...and could not understand the algorithm to compute $a \cdot b \pmod{m}$.uint64_t mul_mod(uint64_t a, uint64_t b, uint64_t m){  long double x;  uint64_t c;  int64_t r;  if (a >= m) a %= m;  if (b >= m) b %= m;  x = a;  c = x * b / m;  r = (int64_t)(a * b - c * m) % (int64_t)m;  return r < 0 ? r + m : r;}I get that:$$ a \cdot b \pmod{m} \equiv ((a \mod{m}) \cdot (b \mod{m})) \mod{m}$$the step I didn't get is c=x*b/mand later doing r = (int64_t)(a * b - c * m) % (int64_t)m; what is that for?The article says: by employing the trick that, by hardware, floating-point  multiplication results in the most significant bits of the product  kept, while integer multiplication results in the least significant  bits keptI can't see how this is related !!!
modular multiplication
algorithm analysis;modular arithmetic