https://bugs.gentoo.org/932579 https://github.com/boostorg/charconv/pull/183 --- a/libs/charconv/src/to_chars.cpp +++ b/libs/charconv/src/to_chars.cpp @@ -620,44 +620,6 @@ boost::charconv::to_chars_result boost::charconv::to_chars(char* first, char* la return boost::charconv::detail::to_chars_float_impl(first, last, value, fmt, precision); } -#else - -boost::charconv::to_chars_result boost::charconv::to_chars( char* first, char* last, long double value, - boost::charconv::chars_format fmt, int precision) noexcept -{ - if (std::isnan(value)) - { - bool is_negative = false; - if (std::signbit(value)) - { - is_negative = true; - *first++ = '-'; - } - - if (issignaling(value)) - { - std::memcpy(first, "nan(snan)", 9); - return { first + 9 + static_cast(is_negative), std::errc() }; - } - else - { - if (is_negative) - { - std::memcpy(first, "nan(ind)", 8); - return { first + 9, std::errc() }; - } - else - { - std::memcpy(first, "nan", 3); - return { first + 3, std::errc() }; - } - } - } - - // Fallback to printf - return boost::charconv::detail::to_chars_printf_impl(first, last, value, fmt, precision); -} - #endif #ifdef BOOST_CHARCONV_HAS_FLOAT128 -- 2.45.2