Table of Contents

Enum BinaryOp

Namespace
NumSharp.Backends.Kernels
Assembly
NumSharp.dll

Binary operations supported by kernel providers.

public enum BinaryOp

Fields

Add = 0
Subtract = 1
Multiply = 2
Divide = 3
Mod = 4
BitwiseAnd = 5
BitwiseOr = 6
BitwiseXor = 7
Power = 8
FloorDivide = 9
Fmod = 10

C-style floating remainder (np.fmod): result takes the sign of the DIVIDEND, unlike Mod (floored, sign of divisor). Scalar-only, all int+float dtypes.

LeftShift = 11
RightShift = 12
ATan2 = 13

Element-wise arc tangent of y/x choosing the quadrant correctly (np.arctan2)

Maximum = 14

Element-wise maximum, NaN-propagating (np.maximum): a NaN operand wins.

Minimum = 15

Element-wise minimum, NaN-propagating (np.minimum): a NaN operand wins.

FMax = 16

Element-wise maximum, NaN-ignoring (np.fmax): returns the non-NaN operand.

FMin = 17

Element-wise minimum, NaN-ignoring (np.fmin): returns the non-NaN operand.

LogAddExp = 18

log(exp(x1)+exp(x2)) computed stably (np.logaddexp).

LogAddExp2 = 19

log2(2x1 + 2x2) computed stably (np.logaddexp2).

NextAfter = 20

Next representable value after x1 toward x2 (np.nextafter).

CopySign = 21

Magnitude of x1 with the sign of x2 (np.copysign).

Hypot = 22

sqrt(x12 + x22) without spurious overflow/underflow (np.hypot). UCRT's faithfully rounded sqrt(xx + yy), NumPy's bits; routed to NDHypotMath, scalar-only like the rest of this family.

Heaviside = 23

The Heaviside step function (np.heaviside): 0 if x1<0, x2 if x1==0, 1 if x1>0, and the positive canonical NaN if x1 is NaN. NOT commutative — x1 selects the branch, x2 is only the x1==0 fill (its exact bits, NaN sign included, pass through). Float-tier promotion like the rest of this family (ATan2), but unlike them it has a branchless SIMD fast path (compare + select, no libm) because every output is an exact value; routed to NDHeavisideMath.

Gcd = 24

Greatest common divisor of |x1| and |x2| (np.gcd). Result is non-negative except where the magnitude wraps the signed range (gcd(int8 -128,-128) == -128). gcd(0,0) == 0.

Lcm = 25

Lowest common multiple of |x1| and |x2| (np.lcm): 0 if either is 0, else |x1|/gcd*|x2| (divide-before-multiply; the product WRAPS the dtype on overflow, matching NumPy).