Integer modulus x - (floorDiv(x, y) * y). Sign matches y and is in the range -|y| < r < |y|. See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#floorMod-long-long-