Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions quaddtype/numpy_quaddtype/src/ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ quad_absolute(const Sleef_quad *op)
return Sleef_fabsq1(*op);
}

static inline Sleef_quad
quad_conjugate(const Sleef_quad *op)
{
// For real numbers, conjugate is the identity function (no-op)
return *op;
}

static inline Sleef_quad
quad_rint(const Sleef_quad *op)
{
Expand Down Expand Up @@ -217,6 +224,13 @@ ld_absolute(const long double *op)
return fabsl(*op);
}

static inline long double
ld_conjugate(const long double *op)
{
// For real numbers, conjugate is the identity function (no-op)
return *op;
}

static inline long double
ld_sign(const long double *op)
{
Expand Down
5 changes: 5 additions & 0 deletions quaddtype/numpy_quaddtype/src/umath/unary_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ init_quad_unary_ops(PyObject *numpy)
if (create_quad_unary_ufunc<quad_absolute, ld_absolute>(numpy, "fabs") < 0) {
return -1;
}
// conjugate is a no-op for real numbers (returns the value unchanged)
if (create_quad_unary_ufunc<quad_conjugate, ld_conjugate>(numpy, "conjugate") < 0) {
return -1;
}
// conj is an alias for conjugate, no need to register
if (create_quad_unary_ufunc<quad_sign, ld_sign>(numpy, "sign") < 0) {
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions quaddtype/release_tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
| rint | ✅ | ✅ |
| sign | ✅ | ✅ |
| heaviside | | |
| conj | | |
| conjugate | | |
| conj | | ✅ |
| conjugate | | ✅ |
| exp | ✅ | ✅ |
| exp2 | ✅ | ✅ |
| log | ✅ | ✅ |
Expand Down
Loading