Example
public
class
ClassA {
Double
d;
Float
f;
public void
methodA() {
boolean
b = d == Double.NaN;
// ...
boolean
c = f == Float.NaN;
// ...
}
}
Solution
Use isNaN() to check if the variables contain a NaN value
Example
public
class
ClassA {
Double
d;
Float
f;
public void
methodA() {
boolean
b = Double.isNaN(d);
// ...
boolean
c = Float.isNaN(f);
// ...
}
}