From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: What version of GMP should we require? Date: Wed, 23 Feb 2011 10:40:45 -0500 Message-ID: <87ipwawygy.fsf@netris.org> References: <87y657wn54.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 1298476560 26379 80.91.229.12 (23 Feb 2011 15:56:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Feb 2011 15:56:00 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Feb 23 16:55:56 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 1PsH4E-0002Fx-6E for guile-devel@m.gmane.org; Wed, 23 Feb 2011 16:55:55 +0100 Original-Received: from localhost ([127.0.0.1]:54614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsGql-00021C-DC for guile-devel@m.gmane.org; Wed, 23 Feb 2011 10:41:59 -0500 Original-Received: from [140.186.70.92] (port=54175 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsGpj-0001al-V3 for guile-devel@gnu.org; Wed, 23 Feb 2011 10:40:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsGpg-0002nd-R7 for guile-devel@gnu.org; Wed, 23 Feb 2011 10:40:53 -0500 Original-Received: from world.peace.net ([216.204.32.208]:54757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsGpg-0002nD-NR for guile-devel@gnu.org; Wed, 23 Feb 2011 10:40:52 -0500 Original-Received: from ip68-9-118-38.ri.ri.cox.net ([68.9.118.38] helo=freedomincluded) by world.peace.net with esmtpa (Exim 4.69) (envelope-from ) id 1PsGpb-0000Of-FN; Wed, 23 Feb 2011 10:40:47 -0500 Original-Received: from mhw by freedomincluded with local (Exim 4.69) (envelope-from ) id 1PsGpa-0001wr-6T; Wed, 23 Feb 2011 10:40:46 -0500 In-Reply-To: <87y657wn54.fsf@netris.org> (Mark H. Weaver's message of "Tue, 22 Feb 2011 20:33:11 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 216.204.32.208 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:11696 Archived-At: I wrote: > I recently noticed that scm_i_big2dbl contains some crufty and > inefficient compatibility code to work around unspecified rounding > behavior of mpz_get_d in GMP prior to version 4.2. GMP 4.2 was released > in March 2006 and has been in Debian since sarge (now oldstable). Sorry, I meant to write "lenny". GMP 4.2 is in lenny, but not in sarge. In any case, I've since found a couple more reasons why requiring GMP 4.2 would be useful. There's another workaround for mpz_cmp_d, which did not recognize infinities before 4.2. More importantly to me is that I have a preliminary patch set to add the R6RS exact-integer-sqrt, as well as the more general exact-integer-root; these both return the floor of the root and the remainder. Based on these, the patch set also makes sqrt and expt return exact rationals when possible (as is done in Gambit), which apart from exactness allows them to work on huge bignums and fractions. Even in the inexact case, the patch set makes sqrt and expt work properly when the result can fit in a double but when the argument is a bignum or fraction too large (or too small) to fit in a double. I was hoping to apply these changes to the 2.0 branch, but exact-integer-root and the enhancements to expt depend on mpz_rootrem, which was introduced in GMP 4.2. I could reimplement its functionality if needed, but the result would surely be somewhat slower. > How would you feel about making Guile 2.0.x require GMP 4.2 or later? > I'm hoping to fix several bugs having to do with rounding in 2.0.x, and > it would simplify things quite a bit if I could trust the rounding > behavior of mpz_get_d. > > Best, > Mark