From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCHES] Numeric improvements Date: Thu, 07 Mar 2013 20:02:27 +0100 Message-ID: <87ip53kp8c.fsf@gnu.org> References: <87vc96ds5w.fsf@tines.lan> <87mwugd3o8.fsf@gnu.org> <87k3pk9sp7.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1362682985 1720 80.91.229.3 (7 Mar 2013 19:03:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Mar 2013 19:03:05 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 07 20:03:29 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UDg6D-0006Kw-7S for guile-devel@m.gmane.org; Thu, 07 Mar 2013 20:03:29 +0100 Original-Received: from localhost ([::1]:49207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDg5r-000741-BD for guile-devel@m.gmane.org; Thu, 07 Mar 2013 14:03:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDg5c-00073J-08 for guile-devel@gnu.org; Thu, 07 Mar 2013 14:03:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDg5N-0004kS-6I for guile-devel@gnu.org; Thu, 07 Mar 2013 14:02:51 -0500 Original-Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=56469 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDg5N-0004gF-0z for guile-devel@gnu.org; Thu, 07 Mar 2013 14:02:37 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 4C0DCCCE1; Thu, 7 Mar 2013 20:02:28 +0100 (CET) Original-Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id acj87GWEDpwX; Thu, 7 Mar 2013 20:02:28 +0100 (CET) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id C5739CAEB; Thu, 7 Mar 2013 20:02:27 +0100 (CET) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 =?utf-8?Q?Vent=C3=B4se?= an 221 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87k3pk9sp7.fsf@tines.lan> (Mark H. Weaver's message of "Wed, 06 Mar 2013 15:30:44 -0500") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2a01:e0b:1:123:ca0a:a9ff:fe03:271e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15884 Archived-At: Mark H Weaver skribis: >> What was the rationale for =E2=80=98round-ash=E2=80=99? > > Well, we need it internally to efficiently convert large integers to > floating-point with proper rounding (see the call to > 'round_right_shift_exact_integer' in patch 5). Given that, it seemed > reasonable to export it to the user, since it's not possible to do that > job efficiently with our current primitives. However, I don't feel > strongly about it. OK, the rationale makes sense to me. >> It seems to address to do two things differently from =E2=80=98ash=E2=80= =99: it=E2=80=99s more >> efficient, and it rounds when right-shifting. The =E2=80=9Cmore efficie= nt=E2=80=9D bit >> is an implementation detail that should also benefit to =E2=80=98ash=E2= =80=99 (as a user >> I don=E2=80=99t want to have to choose between efficient and non-roundin= g.) > > No, 'round-ash' is not more efficient than 'ash'. It's more efficient > than the equivalent (round (* n (expt 2 count))). I see. I misunderstood the documentation=E2=80=99s reference to efficiency. Thanks, Ludo=E2=80=99.