Modulus, works better than '%' for negative values. Numerator Denominator x modulus mod
(int x, int mod)
| 56 | /// <param name="mod">Denominator</param> |
| 57 | /// <returns>x modulus mod</returns> |
| 58 | public static int Mod(int x, int mod) |
| 59 | { |
| 60 | int r = x % mod; |
| 61 | return r<0 ? r+mod : r; |
| 62 | } |
| 63 | } |
| 64 | } |
nothing calls this directly
no outgoing calls
no test coverage detected