Java examples for Language Basics:double
Double.NaN is not equal to itself, which can have some strange consequences.
public class Main { public static void main(String[] args) { double x = Math.sqrt(-50); // Not a number double y = x; if (x == y)/*from ww w .j a v a2 s. c o m*/ System.out.println("x equals y"); } }