8271601: Math.floorMod(int, int) and Math.floorMod(long, long) differ in their logic
Reviewed-by: bpb
This commit is contained in:
parent
57ae9fbe77
commit
66d1faa784
@ -1394,7 +1394,7 @@ public final class Math {
|
||||
public static int floorMod(int x, int y) {
|
||||
int mod = x % y;
|
||||
// if the signs are different and modulo not zero, adjust result
|
||||
if ((mod ^ y) < 0 && mod != 0) {
|
||||
if ((x ^ y) < 0 && mod != 0) {
|
||||
mod += y;
|
||||
}
|
||||
return mod;
|
||||
|
Loading…
x
Reference in New Issue
Block a user