List of utility methods to do Integer Mod
int | modulo(int a, int b) modulo return a - fQuotient(a, b) * b;
|
int | modulo(int dividend, int divisor) Modulo Fix for negative numbers return (dividend % divisor + divisor) % divisor;
|
int | modulo(int x, int m) modulo azzert(m > 0, "m must be > 0"); int y = x % m; if (y < 0) { y += m; return y; |
int | modulo(int x, int mod) The so-called 'euclidean' modulo, a modulo which won't yield negative results if (x >= 0) { return x % mod; int n = 1 + (-x / mod); x += n * mod; return x % mod; |
int | modulo(int x, int y) modulo int z = x % y; return z < 0 ? z + y : z; |
int | moduloPositive(final int value, final int size) modulo Positive int wrappedValue = value % size; wrappedValue += wrappedValue < 0 ? size : 0; return wrappedValue; |
int | moduloPowerOfTwo(final int x, final int powerOfTwoY) modulo Power Of Two return x & (powerOfTwoY - 1);
|
int | modulus(int a, int b) modulus return (a % b + b) % b;
|
int | modulus(int a, int b) modulus if (b == 0) return 0x7fffffff; if (a == 0x80000000 && b == -1) { return 0x7fffffff; return a % b; |
int | modulus(int value, int truncate, boolean flag) modulus int newValue = value % truncate; while (newValue < 0) { newValue += truncate; return newValue; |