Difference between revisions of "Bit.blshift"
From ComputerCraft Wiki
(Undo revision 1933 by 91.121.27.33 (talk)) |
m (Moved to CAT:APIFunctions) |
||
| Line 14: | Line 14: | ||
}} | }} | ||
}} | }} | ||
| + | |||
| + | [[Category:API_Functions]] | ||
Revision as of 18:28, 28 November 2012
| Shifts a number left by a specified number of bits | |
| Syntax | bit.blshift(int n, int bits) |
| Returns | int the value of n shifted left by bits bits, which is equivalent to n×2bits |
| Part of | ComputerCraft |
| API | bit |
Examples
| Shift the number 18 (10010) left by 2 bits, yielding 72 (1001000) | |
| Code |
print(bit.blshift(18, 2)) |
| Output | 72 |