Difference between revisions of "Bit.brshift"
From ComputerCraft Wiki
(Create page) |
m (Moved to CAT:APIFunctions) |
||
| Line 14: | Line 14: | ||
}} | }} | ||
}} | }} | ||
| + | |||
| + | [[Category:API_Functions]] | ||
Revision as of 18:28, 28 November 2012
| Shifts a number right by a specified number of bits | |
| Syntax | bit.brshift(int n, int bits) |
| Returns | int the value of n shifted right by bits bits, which is equivalent to ⌊n÷2bits⌋ |
| Part of | ComputerCraft |
| API | bit |
Examples
| Shift the number 73 (1001001) right by 2 bits, yielding 18 (10010) | |
| Code |
print(bit.brshift(73, 2)) |
| Output | 18 |