class Teste3 {
public static void main
(String[] args
) { float zeroPositivo
= Float.
intBitsToFloat(0); float zeroNegativo
= Float.
intBitsToFloat(0b1000_0000__0000_0000__0000_0000__0000_0000
); System.
out.
println(zeroPositivo
== zeroNegativo
); System.
out.
println(zeroPositivo
!= zeroNegativo
); float nan1
= Float.
intBitsToFloat(0b1111_1111__1000_0000__0000_0000__0000_0001
); float nan2
= Float.
intBitsToFloat(0b1111_1111__1000_0000__0000_0000__0000_0010
); System.
out.
println(nan1
== nan2
); System.
out.
println(nan1
== nan1
); System.
out.
println(nan1
!= nan2
); System.
out.
println(nan1
!= nan1
); }
}
Y2xhc3MgVGVzdGUzIHsKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBmbG9hdCB6ZXJvUG9zaXRpdm8gPSBGbG9hdC5pbnRCaXRzVG9GbG9hdCgwKTsKICAgICAgICBmbG9hdCB6ZXJvTmVnYXRpdm8gPSBGbG9hdC5pbnRCaXRzVG9GbG9hdCgwYjEwMDBfMDAwMF9fMDAwMF8wMDAwX18wMDAwXzAwMDBfXzAwMDBfMDAwMCk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKHplcm9Qb3NpdGl2byA9PSB6ZXJvTmVnYXRpdm8pOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbih6ZXJvUG9zaXRpdm8gIT0gemVyb05lZ2F0aXZvKTsKICAgICAgICBmbG9hdCBuYW4xID0gRmxvYXQuaW50Qml0c1RvRmxvYXQoMGIxMTExXzExMTFfXzEwMDBfMDAwMF9fMDAwMF8wMDAwX18wMDAwXzAwMDEpOwogICAgICAgIGZsb2F0IG5hbjIgPSBGbG9hdC5pbnRCaXRzVG9GbG9hdCgwYjExMTFfMTExMV9fMTAwMF8wMDAwX18wMDAwXzAwMDBfXzAwMDBfMDAxMCk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKG5hbjEgPT0gbmFuMik7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKG5hbjEgPT0gbmFuMSk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKG5hbjEgIT0gbmFuMik7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKG5hbjEgIT0gbmFuMSk7CiAgICB9Cn0=