I had an issue with some NaNs that came from 0/0 not being Canonical in a system I was making and I reduced the problem to this case.
public class Test {
public static void main(String[] args){
Float zero = Float.intBitsToFloat(0);
// Passes
assert Float.floatToRawIntBits(zero) == Float.floatToRawIntBits(0f);
// Fails
assert Float.floatToRawIntBits(zero / zero) == Float.floatToRawIntBits(0f / 0f);
}
}
This is quite bizarre to me. Additionally when debugging with Intellij, watch expressions respond like you would expect; both assertions pass.
I am using openjdk version "1.8.0_131".