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

1 Answer

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

 



answered Nov 4, 2016 by avibootz

Related questions

1 answer 289 views
1 answer 291 views
1 answer 243 views
1 answer 272 views
1 answer 221 views
2 answers 318 views
1 answer 235 views
...