[libcxx-commits] [libcxx] [libcxx] [test] Clarify the condition for long double hex formatting (PR #135334)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Apr 24 05:29:08 PDT 2025
================
@@ -1846,11 +1846,26 @@ void test1() {
void test2() {
std::locale lc = std::locale::classic();
std::locale lg(lc, new my_numpunct);
-#if (defined(__APPLE__) || defined(TEST_HAS_GLIBC) || defined(__MINGW32__)) && defined(__x86_64__)
- // This test is failing on FreeBSD, possibly due to different representations
- // of the floating point numbers.
- // This test is failing in MSVC environments, where long double is equal to regular
- // double, and instead of "0x9.32c05a44p+27", this prints "0x1.26580b4880000p+30".
+#if (defined(__APPLE__) || defined(TEST_HAS_GLIBC) || defined(__MINGW32__)) && defined(__x86_64__) && \
+ __LDBL_MANT_DIG__ == 64
----------------
philnik777 wrote:
Yeah, an abstraction with a slightly prettier name is basically what I'm looking for. Most people don't know that `__LDBL_MANT_DIG__ == 64` is the same as "is an 80 bit long double".
https://github.com/llvm/llvm-project/pull/135334
More information about the libcxx-commits
mailing list