mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-22 07:32:21 +07:00
Fixes IDEA-339464 "Constant values" false positive for NaN GitOrigin-RevId: a7b824f8d6ba0d6a8e4c9dd402ed6810a60e0066
19 lines
308 B
Java
19 lines
308 B
Java
public class DoubleNaN2 {
|
|
public static int compare(double lhs, double rhs) {
|
|
if (lhs == rhs) {
|
|
return 0;
|
|
}
|
|
if (lhs < rhs) {
|
|
return -1;
|
|
}
|
|
|
|
if (lhs > rhs) {
|
|
return 1;
|
|
}
|
|
|
|
if (Double.isNaN(lhs)) {
|
|
return Double.isNaN(rhs) ? 0 : -1;
|
|
}
|
|
return 1;
|
|
}
|
|
} |