[libc-commits] [libc] [libc][math][c23] add c23 floating point fmaximum and fminimum fns (PR #86016)
via libc-commits
libc-commits at lists.llvm.org
Wed Mar 20 15:38:03 PDT 2024
================
@@ -58,6 +58,130 @@ LIBC_INLINE T fmax(T x, T y) {
}
}
+template <typename T, cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>
+LIBC_INLINE T fmaximum(T x, T y) {
+ FPBits<T> bitx(x), bity(y);
+
+ if (bitx.is_nan()) {
+ return x;
+ } else if (bity.is_nan()) {
----------------
lntue wrote:
It's ok for you to keep multiple commits, don't need to `--amend`.
https://github.com/llvm/llvm-project/pull/86016
More information about the libc-commits
mailing list