Difference between revisions of "Shift left"
From WikiManual
m (spam clean up, novel sympathy approach though) |
|||
Line 1: | Line 1: | ||
+ | It picks two stack values shifts the first one bits the amount specified by the second one. | ||
+ | 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. |
Revision as of 11:50, 11 August 2007
It picks two stack values shifts the first one bits the amount specified by the second one.
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.