From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.lisp.guile.user Subject: Re: logical shift operators in guile? Date: Thu, 10 Jun 2010 3:38:21 +0000 Message-ID: <20100610033821.G4TBM.141609.root@cdptpa-web20-z02> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1276141114 1451 80.91.229.12 (10 Jun 2010 03:38:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Jun 2010 03:38:34 +0000 (UTC) Cc: Guile Mailing List To: steve tell , Andy Wingo Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jun 10 05:38:33 2010 connect(): No such file or directory Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OMYbA-0007Za-Ml for guile-user@m.gmane.org; Thu, 10 Jun 2010 05:38:33 +0200 Original-Received: from localhost ([127.0.0.1]:36532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMYb9-0005ZN-Qp for guile-user@m.gmane.org; Wed, 09 Jun 2010 23:38:31 -0400 Original-Received: from [140.186.70.92] (port=60544 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMYb3-0005Yx-Qd for guile-user@gnu.org; Wed, 09 Jun 2010 23:38:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMYb2-0000uj-LH for guile-user@gnu.org; Wed, 09 Jun 2010 23:38:25 -0400 Original-Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.121]:49201) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMYb2-0000uM-Io for guile-user@gnu.org; Wed, 09 Jun 2010 23:38:24 -0400 Original-Received: from cdptpa-web20-z02 ([10.127.132.171]) by cdptpa-smta01.mail.rr.com with ESMTP id <20100610033821091.FVGO20074@cdptpa-smta01.mail.rr.com>; Thu, 10 Jun 2010 03:38:21 +0000 In-Reply-To: X-Priority: 3 (Normal) Sensitivity: Normal X-Originating-IP: X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7858 Archived-At: ---- Andy Wingo wrote: > Hi Steve, > > On Wed 09 Jun 2010 06:04, steve tell 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