[libc-commits] [libc] [libc][math] Add option to set a specific exponent for frexp with Inf/NaN inputs. (PR #112387)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Wed Oct 16 14:51:42 PDT 2024


================
@@ -31,8 +31,12 @@ namespace fputil {
 template <typename T, cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>
 LIBC_INLINE T frexp(T x, int &exp) {
   FPBits<T> bits(x);
-  if (bits.is_inf_or_nan())
+  if (bits.is_inf_or_nan()) {
+#ifdef LIBC_FREXP_INF_NAN_EXPONENT
----------------
nickdesaulniers wrote:

Probably worth a comment here, too.

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


More information about the libc-commits mailing list