[libc-commits] [libc] [libc][complex] Implement different flavors of the `cproj` function (PR #119722)

via libc-commits libc-commits at lists.llvm.org
Tue Dec 17 07:36:42 PST 2024


================
@@ -77,5 +79,17 @@ template <typename T> LIBC_INLINE constexpr T conjugate(T c) {
   return cpp::bit_cast<T>(c_c);
 }
 
+template <typename T> LIBC_INLINE constexpr T project(T c) {
+  Complex<make_real_t<T>> c_c = cpp::bit_cast<Complex<make_real_t<T>>>(c);
----------------
lntue wrote:

nit: refactor `make_real_t<T>` to make it a bit less crowded.

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


More information about the libc-commits mailing list