fork(2) download
  1. class Teste3 {
  2. public static void main(String[] args) {
  3. float zeroPositivo = Float.intBitsToFloat(0);
  4. float zeroNegativo = Float.intBitsToFloat(0b1000_0000__0000_0000__0000_0000__0000_0000);
  5. System.out.println(zeroPositivo == zeroNegativo);
  6. System.out.println(zeroPositivo != zeroNegativo);
  7. float nan1 = Float.intBitsToFloat(0b1111_1111__1000_0000__0000_0000__0000_0001);
  8. float nan2 = Float.intBitsToFloat(0b1111_1111__1000_0000__0000_0000__0000_0010);
  9. System.out.println(nan1 == nan2);
  10. System.out.println(nan1 == nan1);
  11. System.out.println(nan1 != nan2);
  12. System.out.println(nan1 != nan1);
  13. }
  14. }
Success #stdin #stdout 0.1s 27600KB
stdin
Standard input is empty
stdout
true
false
false
false
true
true