Bit Shift Left and Bit Shift Right
- Posted by "Lucius L. Hilley III" <lhilley at CDC.NET> Feb 18, 2000
- 579 views
In the early days of Euphoria I was complaining about Bit shifting as much as you are now. Euphoria now optimizes some math computations into bit shifting... integer i i = rand(324)-- just some random number i *= 2 -- Shift Left i *= 4 -- Shift left twice. i = floor(i/2) -- Shift right i = floor(i/4) -- Shift right twice? PS: if that doesn't actually become a Shift right it is still computationally equivalent. Don't sweat it. Euphoria is pretty fast for an interpreted language. Lucius L. Hilley III lhilley at cdc.net +----------+--------------+--------------+ | Hollow | ICQ: 9638898 | AIM: LLHIII | | Horse +--------------+--------------+ | Software | http://www.cdc.net/~lhilley | +----------+-----------------------------+