Re: shift bits left 8
- Posted by Greg Haberek <ghaberek at gmail.com> Jan 21, 2006
- 536 views
> From the reference manual, I know that multiplying by 2 is optimized int= ernally, and I think that power(2,x) is also. I don't know about multiplyin= g by other multiples of 2.
global function shift_left( integer x, integer bits ) return x * power( 2, bits ) end function global function shift_right( integer x, integer bits ) return floor( x / power( 2, bits ) ) end function
~Greg