binop

The arithmetic and bitwise binary operators.

声明

语法

binop
    = Add
    | Sub
    | Mul
    | Div
    | Pow
    | BitAnd
    | BitOr
    | BitXor
    | BitLShift
    | BitRShift
    | LBitRShift

Values

Value

Meaning

Add

addition.

Sub

subtraction.

Mul

multiplication.

Div

division. For integers it truncates towards zero.

Pow

exponentiation.

BitAnd

bitwise and.

BitOr

bitwise or.

BitXor

bitwise exclusive or.

BitLShift

left shift.

BitRShift

arithmetic right shift, which keeps the sign.

LBitRShift

logical right shift, which shifts in zeros.

返回值

None. An enumeration value is not evaluated.

描述

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.

也可以看看

IntegerBinOp, RealBinOp, ComplexBinOp, cmpop