Number.BitwiseShiftRight
Moves a whole number's bits to the right: each step halves it, dropping what falls off.
Group: Number. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Number.BitwiseShiftRight(number1 as nullable number, number2 as nullable number) as nullable number
| Parameter | Type | Description |
|---|---|---|
number1 | nullable number | The whole number to shift. |
number2 | nullable number | How many bits to move it. |
Returns
nullable number. The number divided by 2 to the power of the shift, the fraction dropped; null when either is null.
Examples
256 shifted four places
Number.BitwiseShiftRight(256, 4)
16
Bits that fall off are lost
Number.BitwiseShiftRight(13, 2)
3
Related functions
Number.BitwiseShiftLeft, Number.BitwiseAnd, Number.IntegerDivide.