binop¶
The arithmetic and bitwise binary operators.
Declaration¶
Syntax¶
binop
= Add
| Sub
| Mul
| Div
| Pow
| BitAnd
| BitOr
| BitXor
| BitLShift
| BitRShift
| LBitRShift
Values¶
Value |
Meaning |
|---|---|
|
addition. |
|
subtraction. |
|
multiplication. |
|
division. For integers it truncates towards zero. |
|
exponentiation. |
|
bitwise and. |
|
bitwise or. |
|
bitwise exclusive or. |
|
left shift. |
|
arithmetic right shift, which keeps the sign. |
|
logical right shift, which shifts in zeros. |
Return values¶
None. An enumeration value is not evaluated.
Description¶
One enumeration serves IntegerBinOp,
RealBinOp,
ComplexBinOp and
UnsignedIntegerBinOp. Which
operators are meaningful depends on the node: the bitwise values are only
valid for the integer nodes, and only Add through Pow are valid for reals
and complex values.