mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue