How to use isInfinite() method with primitive double in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
 
    public static void main(String[] args) {
  
        double d = (double) 1/0;
        boolean b = Double.isInfinite(d);
        System.out.println(b);
    }
}
 
/*
    
run:
    
true

*/

 



answered Nov 3, 2016 by avibootz

Related questions

1 answer 161 views
1 answer 163 views
1 answer 202 views
1 answer 168 views
1 answer 209 views
2 answers 189 views
...