BigInteger.BitwiseAnd(BigInteger, BigInteger) Operador

Definição

Executa uma operação And bit a bit em dois valores BigInteger.

C#
public static System.Numerics.BigInteger operator &(System.Numerics.BigInteger left, System.Numerics.BigInteger right);

Parâmetros

left
BigInteger

O primeiro valor.

right
BigInteger

O segundo valor.

Retornos

O resultado da operação And bit a bit.

Implementações

Comentários

O BitwiseAnd método define a operação bit a bit And para BigInteger valores. A operação bit a bit And define um bit de resultado somente se os bits correspondentes em left e right também estiverem definidos, conforme mostrado na tabela a seguir.

Bit in left Bit in right Bit no resultado
0 0 0
1 0 0
1 1 1
0 1 0

O BitwiseAnd método habilita o código como o seguinte:

C#
BigInteger number1 = BigInteger.Add(Int64.MaxValue, Int32.MaxValue);
BigInteger number2 = BigInteger.Pow(Byte.MaxValue, 10);
BigInteger result = number1 & number2;

O BitwiseAnd método executa a operação bit a bit And em dois BigInteger valores como se ambos estivessem na representação complementar de dois com a extensão de sinal virtual.

Aplica-se a

Produto Versões
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0