Difference between revisions of "Shift left"

From WikiManual
Jump to: navigation, search
m
 
Line 1: Line 1:
It picks two stack values and shifts the first one's bits the amount specified by the second one.
+
Multiples the value on top of the integer stack by 2 using binary logic.
 
 
Shifting 1 by x will return the x power of 2.
 
 
 
Shifting x by 1 is the same as multiplying it by 2.
 
 
 
Shifting x by 2 is the same as multiplying it by 4.
 
 
 
Shifting x by 3 is the same as multiplying it by 8, and so on.
 

Latest revision as of 12:07, 21 December 2016

Multiples the value on top of the integer stack by 2 using binary logic.