Leer en inglés

Compartir a través de


BigInteger.BitwiseAnd(BigInteger, BigInteger) Operador

Definición

Realiza una operación And bit a bit en dos valores BigInteger.

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

Parámetros

left
BigInteger

Primer valor.

right
BigInteger

Segundo valor.

Devoluciones

Resultado de la operación And bit a bit.

Implementaciones

Comentarios

El BitwiseAnd método define la operación bit a bit And para los BigInteger valores. La operación bit a And bit establece un bit de resultado solo si los bits correspondientes en left y right también se establecen, como se muestra en la tabla siguiente.

Bit in left Bit in right Bit en el resultado
0 0 0
1 0 0
1 1 1
0 1 0

El BitwiseAnd método habilita código como el siguiente:

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

El BitwiseAnd método realiza la operación bit a bit And en dos BigInteger valores como si estuvieran en la representación complementaria de dos con extensión de signo virtual.

Se aplica a

Producto Versiones
.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