Is double positive infinity
public class Main {
public static void main(String[] argv) {
double d = 123;
double e = 0;
if (d/e == Double.POSITIVE_INFINITY){
System.out.println("Check for POSITIVE_INFINITY works");
}
double s = Math.sqrt(-1);
if (Double.isNaN(s)){
System.out.println("Double.isNaN() correctly returns 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