bit.blogic rshift
From ComputerCraft Wiki
Revision as of 01:16, 12 July 2013 by Watcher7 (Talk | contribs) (Changed nonexistent type int to type number.)
| Shifts a number right logically by a specified number of bits | |
| Syntax | bit.blogic_rshift(number n, number bits) |
| Returns | number the value of n shifted right by bits bits, with the shifted-in bits all being zero, which is equivalent to ⌊n÷2bits⌋ for nonnegative numbers |
| Part of | ComputerCraft |
| API | bit |
Examples
| Shift the number 73 (1001001) right by 2 bits, yielding 18 (10010) | |
| Code |
print(bit.blogic_rshift(73, 2)) |
| Output | 18 |