---- Andy Wingo <wi...@pobox.com> wrote: > Hi Steve, > > On Wed 09 Jun 2010 06:04, steve tell <t...@telltronics.org> writes: > > > Does guile (1.8.x, or any version) have the integer logical shift > > operators, like C's << and >> ? > > We have ash (arithmetic shift) but not lsh (logical shift). I admit I am > somewhat ignorant regarding when you would prefer lsh over ash. If it is > important (as it probably is) we should add lsh.
It depends on what you do with the sign bit when shifting to the right on 2's complement. Logical shift fills with 0's and arithmetic shift fills with the sign bit. The "logical" functions in guile do work on bignums. No need mess with anything else. -Dale