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
Java Book
Runnable examples
Data Type Double:
- Cast double to integer
- Create Double from double value
- Compare two double type variables within epsilon
- Compare double value arrays for almost equal
- Convert double to string
- Convert Double to numeric primitive data types
- Format double to percentage
- Is Double Infinite
- Is double positive infinity
- Is Double Not a Number(NaN)
- Round a double using BigDecimal
- Round double half up
- Min and Max value fo double type