BigInteger.BitwiseOr(BigInteger, BigInteger) 运算符
定义
对两个 BigInteger 值执行按位 Or 运算。Performs a bitwise Or operation on two BigInteger values.
public:
static System::Numerics::BigInteger operator |(System::Numerics::BigInteger left, System::Numerics::BigInteger right);
public static System.Numerics.BigInteger operator | (System.Numerics.BigInteger left, System.Numerics.BigInteger right);
static member ( ||| ) : System.Numerics.BigInteger * System.Numerics.BigInteger -> System.Numerics.BigInteger
Public Shared Operator Or (left As BigInteger, right As BigInteger) As BigInteger
参数
- left
- BigInteger
第一个值。The first value.
- right
- BigInteger
第二个值。The second value.
返回
按位 Or 运算的结果。The result of the bitwise Or operation.
注解
BitwiseOr方法为值定义按位 Or 运算 BigInteger 。The BitwiseOr method defines the bitwise Or operation for BigInteger values. Or仅当设置了和中的一个或两个对应位时,按位运算才设置结果位 left right ,如下表所示。The bitwise Or operation sets a result bit only if either or both of the corresponding bits in left and right are set, as shown in the following table.
位在 leftBit in left |
位在 rightBit in right |
结果中的位Bit in result |
|---|---|---|
| 00 | 00 | 00 |
| 11 | 00 | 11 |
| 11 | 11 | 11 |
| 00 | 11 | 11 |
BitwiseOr方法启用如下所示的代码:The BitwiseOr method enables code such as the following:
BigInteger number1 = BigInteger.Parse("10343901200000000000");
BigInteger number2 = Byte.MaxValue;
BigInteger result = number1 | number2;
Dim number1 As BigInteger = BigInteger.Parse("10343901200000000000")
Dim number2 As BigInteger = Byte.MaxValue
Dim result As BigInteger = number1 Or number2
BitwiseOr方法 Or 对两个值执行按位运算, BigInteger 就好像它们都是两个具有虚符号扩展的补码表示形式。The BitwiseOr method performs the bitwise Or operation on two BigInteger values as if they were both in two's complement representation with virtual sign extension.