Enum BinaryOp
Binary operations supported by kernel providers.
public enum BinaryOp
Fields
Add = 0Subtract = 1Multiply = 2Divide = 3Mod = 4BitwiseAnd = 5BitwiseOr = 6BitwiseXor = 7Power = 8FloorDivide = 9Fmod = 10C-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 = 11RightShift = 12ATan2 = 13Element-wise arc tangent of y/x choosing the quadrant correctly (np.arctan2)
Maximum = 14Element-wise maximum, NaN-propagating (np.maximum): a NaN operand wins.
Minimum = 15Element-wise minimum, NaN-propagating (np.minimum): a NaN operand wins.
FMax = 16Element-wise maximum, NaN-ignoring (np.fmax): returns the non-NaN operand.
FMin = 17Element-wise minimum, NaN-ignoring (np.fmin): returns the non-NaN operand.
LogAddExp = 18log(exp(x1)+exp(x2)) computed stably (np.logaddexp).
LogAddExp2 = 19log2(2x1 + 2x2) computed stably (np.logaddexp2).
NextAfter = 20Next representable value after x1 toward x2 (np.nextafter).
CopySign = 21Magnitude of x1 with the sign of x2 (np.copysign).
Hypot = 22sqrt(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 = 23The 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 = 24Greatest 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 = 25Lowest 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).