The BITOR function returns the bitwise Boolean OR of 2 numbers. A tabela de verdade de BITOR é fornecida abaixo:
A | B | BITOR(A; B) |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Partes de uma função BITOR
BITOR(valor1; valor2)
Parte | Descrição | Observações |
valor1 |
O primeiro número. |
|
valor2 |
O segundo número. |
|
Fórmulas de amostragem
BITOR(9; 5)
BITOR(A1; 10)
BITOR(A1; B1)
Notas
Talvez faça sentido usar BITOR em conjunto com BINADEC como BITOR(BINADEC("1011"); BINADEC("1001")), que retorna "1011" em binário ou 11 em decimal.
Exemplos
No exemplo a seguir, 9 em binário é "1001" e 5 em binário é 0101. O OR bit a bit de 1001 e 0101 é 1101, que é 13 em decimal.
A | B | |
1 | Fórmula | Resultado |
2 | =BITOR(9; 5) | 13 |
Neste exemplo, o OR bit a bit de 1000 e 0001 é 1001, que é 9 em decimal:
A | B | |
1 | Fórmula | Resultado |
2 | =BITOR(BINADEC("1000"); BINADEC("0001")) | 9 |
Funções relacionadas
- BITAND:A função BITAND retorna a função booleana E bit a bit de dois números. Saiba mais.
- BITXOR: The BITXOR function is a bitwise XOR (exclusive or) of 2 numbers that returns a bit of “1” if 2 bits are different, and a bit of “0” otherwise.
- DESLOCESQBIT: A função DESLOCESQBIT desloca os bits da entrada um determinado número de casas para a esquerda. Os bits à direita são preenchidos com zeros (0).
- DESLOCDIRBIT: The BITRSHIFT function shifts the bits of the input a certain number of places to the right.
- BINADEC: Converte um número binário com sinal em formato decimal.
- DECABIN: Converte um número decimal em formato binário com sinal.