bit.blshift

From ComputerCraft Wiki
Revision as of 17:11, 4 December 2012 by AfterLifeLochie (Talk | contribs) (Reverted edits by 199.19.105.156 (talk) to last revision by Lyqyd)

Jump to: navigation, search


Grid Redstone.png  Function bit.blshift
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

Grid paper.png  Example
Shift the number 18 (10010) left by 2 bits, yielding 72 (1001000)
Code
print(bit.blshift(18, 2))
Output 72