[libc-commits] [libc] [libc][complex] Implement different flavors of the `conj` function (PR #118671)
via libc-commits
libc-commits at lists.llvm.org
Mon Dec 9 10:00:08 PST 2024
================
@@ -16,5 +16,12 @@ template <typename T> struct Complex {
T real;
T imag;
};
+
+template <typename T, typename U> T conjugate(T c) {
----------------
lntue wrote:
Bringing `cfloat16` and `cfloat128` into `complex` with extra guards are ok. One of the benefits is that it allows you to make the templated implementations to have only 1 template parameter, instead of having to specifying in both real type and complex type, reducing the clutter and chances of copy-paste errors.
https://github.com/llvm/llvm-project/pull/118671
More information about the libc-commits
mailing list