java.lang.Double.isNan(double v)


java.lang.Double.isNan(double v)

package com.codingdict;



import java.lang.*;



public class DoubleDemo {



   public static void main(String[] args) {



      Double d1 = new Double(-1.0/0.0);

      Double d2 = new Double(0.0/0.0);



      // returns true if this Double value is a Not-a-Number (NaN) 

      System.out.println(d1 + " = " + d1.isNaN(d1));



      // returns false for other cases

      System.out.println(d2 + " = " + d2.isNaN(d2));

   }

}