BITLSHIFT
A whole number's bits shifted left by a number of places.
Group: Math. Compatible with DAX.
Syntax
BITLSHIFT ( <Number>, <Shift_Amount> )
| Parameter | Type | Description |
|---|---|---|
Number | Whole number | The number whose bits move. |
Shift_Amount | Whole number | How many places they move to the left; a negative amount moves them right. |
Returns
Whole number. The number with its bits moved left: each place doubles it.
Remarks
BITLSHIFT ( 1, 4 )is 16, andBITLSHIFT ( 5, -1 )moves one place right instead, giving 2.- Numbers are 64 bits wide; keep the amount between -63 and 63.
- A blank number gives BLANK; a blank amount counts as 0.
Examples
Moving bits to the left
EVALUATE
ROW (
"1 by 4", BITLSHIFT ( 1, 4 ),
"5 by -1", BITLSHIFT ( 5, -1 ),
"3 by blank", BITLSHIFT ( 3, BLANK () )
)
| 1 by 4 | 5 by -1 | 3 by blank |
|---|---|---|
| 16 | 2 | 3 |