@@ -47,7 +47,6 @@ BOOST_AUTO_TEST_CASE(double_serfloat_tests) {
4747 BOOST_CHECK_EQUAL (TestDouble (4.0 ), 0x4010000000000000ULL );
4848 BOOST_CHECK_EQUAL (TestDouble (785.066650390625 ), 0x4088888880000000ULL );
4949
50- // Roundtrip test on IEC559-compatible systems
5150 if (std::numeric_limits<double >::is_iec559) {
5251 BOOST_CHECK_EQUAL (sizeof (double ), 8U );
5352 BOOST_CHECK_EQUAL (sizeof (uint64_t ), 8U );
@@ -64,8 +63,7 @@ BOOST_AUTO_TEST_CASE(double_serfloat_tests) {
6463 TestDouble (-std::numeric_limits<double >::signaling_NaN ());
6564 TestDouble (std::numeric_limits<double >::denorm_min ());
6665 TestDouble (-std::numeric_limits<double >::denorm_min ());
67- // Test exact encoding: on currently supported platforms, EncodeDouble
68- // should produce exactly the same as the in-memory representation for non-NaN.
66+ // On IEC559-compatible systems, construct doubles to test from the encoding.
6967 for (int j = 0 ; j < 1000 ; ++j) {
7068 // Iterate over 9 specific bits exhaustively; the others are chosen randomly.
7169 // These specific bits are the sign bit, and the 2 top and bottom bits of
@@ -92,8 +90,7 @@ BOOST_AUTO_TEST_CASE(double_serfloat_tests) {
9290 if (x & 256 ) v |= (uint64_t {1 } << 63 );
9391 double f;
9492 memcpy (&f, &v, 8 );
95- uint64_t v2 = TestDouble (f);
96- if (!std::isnan (f)) BOOST_CHECK_EQUAL (v, v2);
93+ TestDouble (f);
9794 }
9895 }
9996 }
0 commit comments