Bit Operation Functions

Π—Π° Π΄Π° пристапитС Π΄ΠΎ ΠΎΠ²Π°Π° Π½Π°Ρ€Π΅Π΄Π±Π°...

Π’ΠΌΠ΅Ρ‚Π½ΠΈ - Π€ΡƒΠ½ΠΊΡ†ΠΈΡ˜Π° - ΠšΠ°Ρ‚Π΅Π³ΠΎΡ€ΠΈΡ˜Π° ΠœΠ°Ρ‚Π΅ΠΌΠ°Ρ‚ΠΈΡ‡ΠΊΠΈ


BITAND

Returns a bitwise logical "and" of the parameters.

Syntax

BITAND(number1; number2)

Number1 and number2 are positive integers less than 2 ^ 48 (281 474 976 710 656).

ΠŸΡ€ΠΈΠΌΠ΅Ρ€

=BITAND(6;10) returns 2 (0110 & 1010 = 0010).

BITLSHIFT

Shifts a number left by n bits.

Syntax

BITLSHIFT(number; shift)

Number is a positive integer less than 2 ^ 48 (281 474 976 710 656).

Shift is the number of positions the bits will be moved to the left. If shift is negative, it is synonymous with BITRSHIFT (number; -shift).

ΠŸΡ€ΠΈΠΌΠ΅Ρ€

=BITLSHIFT(6;1) returns 12 (0110 << 1 = 1100).

BITOR

Returns a bitwise logical "or" of the parameters.

Syntax

BITOR(number1; number2)

Number1 and number2 are positive integers less than 2 ^ 48 (281 474 976 710 656).

=BITOR(6;10) returns 14 (0110 | 1010 = 1110).

BITRSHIFT

Shifts a number right by n bits.

Syntax

BITRSHIFT(number; shift)

Number is a positive integer less than 2 ^ 48 (281 474 976 710 656).

Shift is the number of positions the bits will be moved to the right. If shift is negative, it is synonymous with BITLSHIFT (number; -shift).

ΠŸΡ€ΠΈΠΌΠ΅Ρ€

=BITRSHIFT(6;1) returns 3 (0110 >> 1 = 0011).

BITXOR

Returns a bitwise logical "exclusive or" of the parameters.

Syntax

BITXOR(number1; number2)

Number1 and number2 are positive integers less than 2 ^ 48 (281 474 976 710 656).

ΠŸΡ€ΠΈΠΌΠ΅Ρ€

=BITXOR(6;10) returns 12 (0110 ^ 1010 = 1100)