Exemple
public
class
ClasseA {
Double
d;
Float
f;
public void
methodeA() {
boolean
b = d == Double.NaN;
// ...
boolean
c = f == Float.NaN;
// ...
}
}
Solution
Utilisez isNaN() pour tester si les variables contiennent une valeur NaN
Exemple
public
class
ClasseA {
Double
d;
Float
f;
public void
methodeA() {
boolean
b = Double.isNaN(d);
// ...
boolean
c = Float.isNaN(f);
// ...
}
}