Return | Method | Summary |
---|---|---|
boolean | isInfinite() | Returns true if this Double value is infinitely large in magnitude, false otherwise. |
static boolean | isInfinite(double v) | Returns true if the specified number is infinitely large in magnitude, false otherwise. |
boolean | isNaN() | Returns true if this Double value is a Not-a-Number (NaN), false otherwise. |
static boolean | isNaN(double v) | Returns true if the specified number is a Not-a-Number (NaN) value, false otherwise. |
public class Main {
public static void main(String[] args) {
Double double1 = new Double(1/0.0);
System.out.println(double1.isInfinite());
}
}
The output:
true
public class Main {
public static void main(String[] args) {
Double double1 = new Double(0.0/0.0);
System.out.println(Double.isNaN(double1));
System.out.println(double1.isNaN());
}
}
The output:
true
true
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |