guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What version of GMP should we require?


From: Mark H Weaver
Subject: Re: What version of GMP should we require?
Date: Wed, 23 Feb 2011 10:40:45 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]