public static long unsignedModulo(long numerator, long denominator) {
		if (denominator < 0) {
			throw new IllegalArgumentException("denomintor too big");
		}
		if (numerator >= 0) {
			return numerator % denominator;
		}
		// handle negative numerator value
		long numeratorDiv2 = numerator >>> 1;
		long remainder = (numeratorDiv2 % denominator) << 1;
		remainder += (numerator & 1);
		return remainder % denominator;
	}
Perform unsigned modulo. Provides proper handling of all 64-bit unsigned values.

@param numerator unsigned numerator
@param denominator positive divisor
@return result of unsigned modulo (i.e., remainder)
@throws IllegalArgumentException if negative denominator is specified
Ghidra/Framework/Generic/src/main/java/ghidra/util/MathUtilities.java