diff --git a/test/value.cpp b/test/value.cpp index 9e650c040..131062324 100644 --- a/test/value.cpp +++ b/test/value.cpp @@ -1473,8 +1473,9 @@ class value_test THRO(std::uint16_t); EQUS(std::uint32_t); EQUS(std::uint64_t); - EQUF(float); EQAL(double); + // EQUF(float) will result in loss of precision, so the test might + // fail depending on compilation flags and target platform } { auto V = max_of(); @@ -1487,8 +1488,9 @@ class value_test THRO(std::uint16_t); THRO(std::uint32_t); EQUS(std::uint64_t); - EQUF(float); EQUF(double); + // EQUF(float) will result in loss of precision, so the test might + // fail depending on compilation flags and target platform } //--- { @@ -1647,6 +1649,19 @@ class value_test EQAL(float); EQAL(double); } + //--- + { + // fill with the number of ones equal to the size of float's + // mantissa; such a number can be converted to float without loss + // of precision + std::int64_t V = 1; + for( int i = 0; i <= std::numeric_limits::digits - 1; ++i ) + V *= 2; + --V; + + value const jv(V); + EQUF(float); + } error_code ec; value(nullptr).to_number(ec);