[libcxx-commits] [libcxx] [libc++][test][NFC] Use correct number of digits for <numbers> ground-truth values (PR #233664)

Eric Ross via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 19 21:03:49 PDT 2026


================
@@ -40,11 +43,11 @@ constexpr bool tests() {
 
   assert(std::numbers::ln2 == 0x1.62e42fefa39efp-1);
   assert(std::numbers::ln2_v<double> == 0x1.62e42fefa39efp-1);
-  assert(std::numbers::ln2_v<float> == 0x1.62e42fp-1f);
+  assert(std::numbers::ln2_v<float> == 0x1.62e430p-1f);
----------------
ZERICO2005 wrote:

`float` only has 24 bits of precision, so all of the "exact" float literals should end with an even digit.

https://github.com/llvm/llvm-project/pull/233664


More information about the libcxx-commits mailing list