Как пользоваться функцией BITRSHIFT в Excel
Русский | Английский |
---|---|
БИТ.СДВИГП | BITRSHIFT |
The BITRSHIFT function performs a bitwise right shift, moving the bits of a number to the right by a specified number of positions. This function is available in both Microsoft Excel and Google Sheets.
Syntax:
In Microsoft Excel:
=BITRSHIFT(number, shift_amount)
In Google Sheets:
=BITRSHIFT(number, shift_amount)
where:
number
is the number whose bits you want to shift.shift_amount
is the number of positions to shift the bits right.
Example Applications:
1. Shifting the bits of a number 2 positions to the right.
number | shift_amount | Result |
---|---|---|
22 | 2 | =BITRSHIFT(22, 2) |
Using this function, the result is 5. Explanation: the number 22 in binary form is 10110. After shifting right by 2 positions, we obtain 101, which is 5 in decimal.
2. Hiding the two least significant bits of a number.
number | shift_amount | Result |
---|---|---|
11 | 2 | =BITRSHIFT(11, 2) |
With this function, the result is 2. Explanation: the number 11 in binary form is 1011. After a shift two positions to the right, we obtain 10, which is 2 in decimal.
Thus, the BITRSHIFT function is useful for bit-level operations and manipulations where a rightward bit shift of a specific number of positions is necessary.
Больше информации: https://support.microsoft.com/ru-ru/office/бит-сдвигп-функция-бит-сдвигп-274d6996-f42c-4743-abdb-4ff95351222c