From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] round-ash, a rounding arithmetic shift operator Date: Sun, 20 Feb 2011 23:06:05 +0100 Message-ID: References: <87vd0l631d.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1298239300 22788 80.91.229.12 (20 Feb 2011 22:01:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 20 Feb 2011 22:01:40 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 20 23:01:34 2011 Return-path: Envelope-to: guile-devel@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 1PrHLR-00051X-Oy for guile-devel@m.gmane.org; Sun, 20 Feb 2011 23:01:34 +0100 Original-Received: from localhost ([127.0.0.1]:41951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrHLP-0005mG-4Y for guile-devel@m.gmane.org; Sun, 20 Feb 2011 17:01:31 -0500 Original-Received: from [140.186.70.92] (port=52963 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrHKu-0005YX-Q3 for guile-devel@gnu.org; Sun, 20 Feb 2011 17:01:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrHKt-0004zf-IK for guile-devel@gnu.org; Sun, 20 Feb 2011 17:01:00 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:40713 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrHKt-0004zN-E6 for guile-devel@gnu.org; Sun, 20 Feb 2011 17:00:59 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 2965E3B8A; Sun, 20 Feb 2011 17:02:08 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=B2WeIUam/CBHoUjFqaIotP1GkmU=; b=G0rQ9F /xnkm1Y/zAYKVB9mIcwfKlsYMLp592oAi5kSQhZSHmLAbtGSCMJIBTDoSCEhrzvC RlaY0hzg/LYnVgR2OJfneIlHqYinxYaJWOhqLJZoJ3Lotmx+zRqsOvn7QQNC/eNd dYRv9r5YCc3OLFyZVuA0IE3xH15HP5wf1vRGc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=WG2ncZ57XOkq8/YoydznV2jsappLSAJE 4p7T8XTSVmW9dEIpibnq5Pw1R59Po95eFrwGvig7wuxxFy4tsPm3ej/VdsdDeX5o bhy9RVtP7bixIgnjPPS+2J/6vWGap0jJp9wXJO4bEtT+0suu6btUJ2CM71FlQ8+P FIZC2HK7Ruw= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id EEF5E3B89; Sun, 20 Feb 2011 17:02:06 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 5641D3B87; Sun, 20 Feb 2011 17:02:05 -0500 (EST) In-Reply-To: <87vd0l631d.fsf@netris.org> (Mark H. Weaver's message of "Tue, 15 Feb 2011 04:49:18 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 0EA9519A-3D3D-11E0-B3FA-AF401E47CF6F-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11667 Archived-At: On Tue 15 Feb 2011 10:49, Mark H Weaver writes: > The first patch is trivial, but there for the sake of correctness. Please apply, thanks. > The second patch adds round-ash, a rounding arithmetic shift operator. > > (round-ash n count) ==> (round (* n (expt 2 count))) > > but it's implemented much more efficiently than that, and requires that > both n and count are exact integers. It cannot be implemented very > efficiently in scheme, and I needed it to normalize floating-point > significands using the default IEEE rounding mode. I think it probably > has wider utility. It would be great to have it in 2.0. Any chance? I'm not sure I understand the name. There is no need to call "round" on the result of calling "ash". Can you think of another name? Cheers, Andy -- http://wingolog.org/