You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add scalar (single-value) overloads for all element-wise functions
Add numpy::sqrt(x), numpy::sin(x), numpy::exp(x), ... scalar overloads
inside namespace numpy, coexisting with the existing array API (different
argument count / types, no ambiguity).
Every scalar overload delegates to the public array API via &x, &x, 1 —
never to detail:: — so AVX-512 specialisations and future array-level
optimisations are automatically inherited.
Unary (T → T):
sqrt abs exp log sin cos tan cbrt expm1 log1p
log10 log2 arcsin arccos arctan round floor ceil
degrees radians sign
Binary (T, T → T):
power(x,e) hypot(x,y) arctan2(y,x) maximum(a,b) minimum(a,b)
Ternary (T, T, T → T):
clip(x, lo, hi)
Usage:
double r = numpy::sqrt(2.0);
float s = numpy::sin(x);
double n = numpy::hypot(3.0, 4.0);
double c = numpy::clip(val, lo, hi);
Both bit-exact and std builds verified.
0 commit comments