1// Copyright 2024 Matt Borland
2// Distributed under the Boost Software License, Version 1.0.
3// https://www.boost.org/LICENSE_1_0.txt
4//
5// See: https://github.com/boostorg/charconv/issues/154
6
7#include <boost/charconv.hpp>
8#include <boost/core/lightweight_test.hpp>
9
10int main()
11{
12 #if BOOST_CHARCONV_LDBL_BITS == 80
13 const long double test_value = -35896.53987658756543653653365436L;
14 char buffer[256] {};
15 auto r = boost::charconv::to_chars(first: buffer, last: buffer + sizeof(buffer), value: test_value, fmt: boost::charconv::chars_format::hex);
16 BOOST_TEST(r);
17 BOOST_TEST_CSTR_EQ(buffer, "-8.c388a355a1f783ap+12");
18 #endif
19
20 return boost::report_errors();
21}
22

source code of boost/libs/charconv/test/github_issue_154.cpp