[libc-commits] [libc] [libc][math][c23] add c23 floating point fmaximum and fminimum fns (PR #86016)

Job Henandez Lara via libc-commits libc-commits at lists.llvm.org
Wed Mar 20 15:20:27 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()) {
----------------
Jobhdez wrote:

ok I will fix it. is it ok after I make my changes to do 

```
$ git add
$ git commit --amend
$ git push --force
```
So I can keep it at two commits?

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


More information about the libc-commits mailing list