[libcxx-commits] [libcxx] [libcxx][test][z/OS] Fix hermite.pass.cpp for HEX float (PR #101019)

Zibi Sarbinowski via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 1 11:46:52 PDT 2024


================
@@ -26,7 +26,13 @@
 
 #include "type_algorithms.h"
 
-inline constexpr unsigned g_max_n = 128;
+template <class Real>
+constexpr unsigned get_maximal_order() {
+  if constexpr (std::numeric_limits<Real>::max_exponent10 < std::numeric_limits<Real>::max_exponent)
----------------
zibi2 wrote:

> This might not test what we actually need. My idea was rather along the lines of max_exponent10< 60 then return 39 else if max_exponent10 <... return 128. Hope this helps otherwise let me know and I can reformulate this. We should check which exponents we actually need here (e.g. the 60 and ... above).

I think we need to check `max_exponent` since its value is 128 for float, and 1024 for both double and long double on  Linux on Power (LoP). However on zOS, it is 63 for all float types on zOS. 

The `max_exponent10` is 38 for float and 308 for both double and long double on LoP and 75 for all float type on z/OS.

Let me know if you have anything else in mind.


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


More information about the libcxx-commits mailing list