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

1 Answer

0 votes
package javaapplication1;
  
public class JavaApplication1 {
   
    public static void main(String[] args) {
    
        float f = (float) 1 / 0;
        
        boolean b = Float.isInfinite(f);
        System.out.println(b);
    }
}
   
/*
      
run:
      
true
  
*/

 



answered Nov 4, 2016 by avibootz

Related questions

1 answer 227 views
1 answer 248 views
1 answer 288 views
1 answer 239 views
1 answer 295 views
2 answers 325 views
1 answer 241 views
...