[libcxx-commits] [PATCH] D77505: [libc++] Implement <numbers>

Richard Smith - zygoloid via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 6 14:43:21 PDT 2020


rsmith added a comment.

Should we have some kind of test coverage that the values of these constants are correct?



================
Comment at: libcxx/test/std/numerics/numbers/non_floating_point.fail.cpp:13-25
+int e{std::numbers::e_v};
+int log2e{std::numbers::log2e_v};
+int log10e{std::numbers::log10e_v};
+int pi{std::numbers::pi_v};
+int inv_pi{std::numbers::inv_pi_v};
+int inv_sqrtpi{std::numbers::inv_sqrtpi_v};
+int ln2{std::numbers::ln2_v};
----------------
These are all missing their template arguments. I'm not sure exactly what this test is checking for, but I'm assuming it's not that these result in parse errors. (Should these tests omit the `_v` to check for a narrowing conversion, or should they include the `<int>` to check the floating-point constraint?)


================
Comment at: libcxx/test/std/numerics/numbers/user_type.pass.cpp:18-30
+user_type e{std::numbers::e_v};
+user_type log2e{std::numbers::log2e_v};
+user_type log10e{std::numbers::log10e_v};
+user_type pi{std::numbers::pi_v};
+user_type inv_pi{std::numbers::inv_pi_v};
+user_type inv_sqrtpi{std::numbers::inv_sqrtpi_v};
+user_type ln2{std::numbers::ln2_v};
----------------
These are similarly missing their template arguments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77505/new/

https://reviews.llvm.org/D77505





More information about the libcxx-commits mailing list