X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=fp16_test.cpp;h=bb8b18280d1f487889680d307286c476403cb5f8;hp=3deb74b32a9f3e3c5dec92807cec8aa08a01eea9;hb=40895e45c801a010f8bed037636e66afe0fddae2;hpb=55cff1809758210474fe6c22aaed8033d10343b3 diff --git a/fp16_test.cpp b/fp16_test.cpp index 3deb74b..bb8b182 100644 --- a/fp16_test.cpp +++ b/fp16_test.cpp @@ -41,7 +41,8 @@ union fp32 { }; TEST(FP16Test, NaN) { - EXPECT_EQ(0xfe00, fp64_to_fp16(0.0 / 0.0)); + // Ignore the sign bit. + EXPECT_EQ(0x7e00, fp64_to_fp16(0.0 / 0.0) & 0x7fff); EXPECT_TRUE(isnan(fp16_to_fp64(0xfe00))); fp64 borderline_inf;