public static boolean realEquals(float a, float b)
    {
        // the first check ensures +0 == -0 is true. the second ensures that NaN == NaN is true
        // for all other cases a == b and floatToIntBits(a) == floatToIntBits(b) will return
        // the same result
        // floatToIntBits converts all NaNs to the same representation
        return a == b || floatToIntBits(a) == floatToIntBits(b);
    }
@Test
    public void testRealEquals()
    {
        assertTrue(realEquals(0, Float.parseFloat("-0")));
        assertTrue(realEquals(Float.NaN, Float.NaN));
        // 0x7fc01234 is a different representation of NaN
        assertTrue(realEquals(Float.NaN, intBitsToFloat(0x7fc01234)));
    }