Difference between revisions of "Bit.blshift"

From ComputerCraft Wiki
Jump to: navigation, search
(Love Computer)
(Undo revision 1933 by 91.121.27.33 (talk))
Line 1: Line 1:
I after to share this position I found when looking for ignore auto parts, they saved me 100s of dollars when I was getting my buggy second on the passage mould month, so I ruminating I'd restore the karma and give them a do in on here. On the whole 'deduction auto parts' turn at large to be anything but, and you consequence up spending over-the-odds concerning poor dignity parts and yeah, that's no longer a blunder I can provide to up, who can in this restraint, right? So, rpm-motots-inc.com are different, like extraordinarily, surely different. First up, the amount you are quoted is the quotation you pay, no hidden extras. The parts I ordered were all in dynasty, were shipped stable and were superbly packaged. I was amazed with the grade, especially instead of the low price I paid, which was
+
{{lowercase}}
$391 cheaper than the accessible allowance auto parts sites. I had a hardly questions before I ordered and the staff I spoke to were extraordinarily beneficial, and knew their stuff. Their customer overhaul and variety of parts is impressive, rpm motors certainly keep their promises when it comes to reduce auto parts.
+
{{Function
 +
|name=bit.blshift
 +
|args=[[int (type)|int]] n, [[int (type)|int]] bits
 +
|api=bit
 +
|returns=[[int]] the value of <var>n</var> shifted left by <var>bits</var> bits, which is equivalent to <var>n</var>×2<sup><var>bits</var></sup>
 +
|addon=ComputerCraft
 +
|desc=Shifts a number left by a specified number of bits
 +
|examples=
 +
{{Example
 +
|desc=Shift the number 18 (10010) left by 2 bits, yielding 72 (1001000)
 +
|code=print(bit.blshift(18, 2))
 +
|output=72
 +
}}
 +
}}

Revision as of 02:36, 4 July 2012


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