diff --git a/include/boost/multiprecision/cpp_double_float.hpp b/include/boost/multiprecision/cpp_double_float.hpp index 0419126e..3f416941 100644 --- a/include/boost/multiprecision/cpp_double_float.hpp +++ b/include/boost/multiprecision/cpp_double_float.hpp @@ -880,22 +880,22 @@ operator<<(std::basic_ostream& os, const cpp_double_floa return os; } - if (f < FloatingPointType(0) || os.flags() & std::ios::showpos) - os << (f < FloatingPointType(0) ? "-" : "+"); + if (f < cpp_double_float(0) || os.flags() & std::ios::showpos) + os << (f < cpp_double_float(0) ? "-" : "+"); int exp10 = 0; - if (f != FloatingPointType(0)) + if (f != cpp_double_float(0)) exp10 = (int)floor(log10(fabs(f.first()))); else exp10 = 0; - auto f_prime = (f > FloatingPointType(0) ? f : -f); + auto f_prime = (f > cpp_double_float(0) ? f : -f); f_prime /= cpp_double_float::pow10(exp10); // TODO Handle subnormal numbers - if (f_prime < FloatingPointType(1) && f_prime > FloatingPointType(0)) + if (f_prime < cpp_double_float(1) && f_prime > cpp_double_float(0)) { f_prime *= FloatingPointType(10); exp10++; diff --git a/test/test_cpp_double_float_arithmetic.cpp b/test/test_cpp_double_float_arithmetic.cpp index 88a6fe81..1699fc96 100644 --- a/test/test_cpp_double_float_arithmetic.cpp +++ b/test/test_cpp_double_float_arithmetic.cpp @@ -152,7 +152,7 @@ int test_op(char op, const unsigned count = 10000U) if (delta > MaxError) { std::cerr << std::setprecision(std::numeric_limits::digits10 + 2); - std::cerr << " [FAILED] while performing '" << ctrl_a << "' " << op << " '" << ctrl_b << "'" << std::endl; + std::cerr << " [FAILED] while performing '" << std::setprecision(100000) << ctrl_a << "' " << op << " '" << ctrl_b << "', got incorrect result: " << (df_c) << std::endl; // uncomment for more debugging information (only for cpp_double_float<> type) //std::cerr << "(df_a = " << df_a.get_raw_str() << ", df_b = " << df_b.get_raw_str() << ")" << std::endl;