Is Double Not a Number(NaN)


public class Main {

  public static void main(String[] args) {
    double d = Math.sqrt(-10);
    boolean b1 = Double.isNaN(d);

    System.out.println(b1);

    Double dObj = new Double(d);
    boolean b2 = dObj.isNaN();
    System.out.println(b2);

  }

}

Output:


true
true
Home 
  Java Book 
    Runnable examples  

Data Type Double:
  1. Cast double to integer
  2. Create Double from double value
  3. Compare two double type variables within epsilon
  4. Compare double value arrays for almost equal
  5. Convert double to string
  6. Convert Double to numeric primitive data types
  7. Format double to percentage
  8. Is Double Infinite
  9. Is double positive infinity
  10. Is Double Not a Number(NaN)
  11. Round a double using BigDecimal
  12. Round double half up
  13. Min and Max value fo double type