[libc-commits] [libc] [libc][math][c23] Add nextup{, f, f128} and nextdown{, f, f128} functions (PR #85431)
via libc-commits
libc-commits at lists.llvm.org
Fri Mar 15 10:38:03 PDT 2024
================
@@ -230,6 +230,27 @@ LIBC_INLINE T nextafter(T from, U to) {
return from_bits.get_val();
}
+template <typename T, cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>
+LIBC_INLINE T nextupdown(T x, Sign sign) {
----------------
lntue wrote:
Use the second template parameter for the `sign`, and use `enable_if_t` on the return type instead.
Also mark this function `constexpr` if possible.
https://github.com/llvm/llvm-project/pull/85431
More information about the libc-commits
mailing list