On Mon, Dec 7, 2015 at 9:16 AM, Mark Waddingham <[email protected]> wrote:
> Although it's important to remember that shift left by n bits is the same > as multiplying by 2^n, and right is the same as div by 2^n. Rotate is a > little trickier, admittedly. > > Mark > Sure, I didn't say it was particularly difficult, just that it slowed me down a bit (ha! pun!). The values in question were limited to 16 bit, so my functions ended up as: function rShift V,S return V div 2^S end rShift function lShift V,S return (V * 2^S) mod 65536 end lShift _______________________________________________ use-livecode mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
