diff --git a/test/from_chars_float.cpp b/test/from_chars_float.cpp index 3451fae0e..5dd36c7cc 100644 --- a/test/from_chars_float.cpp +++ b/test/from_chars_float.cpp @@ -416,7 +416,7 @@ void test_issue_45(T v, const std::string& full_buffer, const std::ptrdiff_t ptr auto r = boost::charconv::from_chars(full_buffer.c_str(), full_buffer.c_str() + ptr, from_v, fmt); // v may not be exactly representable, so we only test within an epsilon - if (!((std::abs(v - from_v) < std::numeric_limits::epsilon()) && BOOST_TEST_EQ(ptr, std::ptrdiff_t(r.ptr - full_buffer.c_str())))) + if (!(BOOST_TEST((std::abs(v - from_v) < std::numeric_limits::epsilon())) && BOOST_TEST_EQ(ptr, std::ptrdiff_t(r.ptr - full_buffer.c_str())))) { std::cerr << std::setprecision(std::numeric_limits::digits10 + 1) << "\nFrom chars value: " << from_v @@ -487,11 +487,11 @@ int main() test_issue_37(); #endif - test_issue_45(static_cast(-4109895455460520), "-4109895455460520.513430", 19); + test_issue_45(static_cast(-4109895455460520.5), "-4109895455460520.513430", 19); test_issue_45(1.035695536657502e-308, "1.0356955366575023e-3087", 23); - test_issue_45(static_cast(-1985444280612224), "-1985444280612224.5e+258", 19); + test_issue_45(static_cast(-1985444280612224.5), "-1985444280612224.5e+258", 19); test_issue_45(2.196197480766336e-308, "2.196197480766336e-30889", 22); - test_issue_45(static_cast(278061055647718), "278061055647717.5e-2288", 18); + test_issue_45(static_cast(278061055647717.5), "278061055647717.5e-2288", 17); // Value in range with 20 million digits. Malloc should max out at 16'711'568 bytes test_strtod_routines(1.982645139827653964857196,