GNU bug report logs - #10519
guile and (mini-)gmp

Previous Next

Package: guile;

Reported by: nisse <at> lysator.liu.se (Niels Möller)

Date: Sun, 15 Jan 2012 22:01:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw <at> netris.org>
Cc: 10519 <at> debbugs.gnu.org, Niels Möller <nisse <at> lysator.liu.se>, Torbjorn Granlund <tg <at> gmplib.org>
Subject: bug#10519: guile and (mini-)gmp
Date: Sun, 22 Jul 2012 11:04:25 +0200
Hi Mark!

Mark H Weaver <mhw <at> netris.org> skribis:

> nisse <at> lysator.liu.se (Niels Möller) writes:
>> 2. The next problem is maybe more a nuisance than a real problem. I'm
>>    looking at scm_i_big2dbl, in numbers.c.
>>
>>    I notice this code doesn't currently use mpz_get_d (comment says
>>    that's because gmp-4.2 and earlier didn't do well-defined rounding).

[...]

> Don't worry about this.  I have a patch set that (among other things)
> reimplements scm_i_big2dbl in a much more robust way, with proper
> rounding, and without using such low-level GMP accessors.  I posted this
> patch set to guile-devel on 7 Oct, "[PATCH] Improvements to exact
> rationals et al".  I will resubmit it soon.

Apparently this didn’t make it into the tree yet, right?  Could you
resubmit it?

>> 3. Occcasional use of mpq functions (do_divide, scm_inexact_to_exact),
>>    for conversion of fradctions to and from doubles. mini-gmp has no
>>    mpq-functions (and it shouldn't have), so these calls have to either
>>    be eliminated altogether, or be made conditional on HAVE_LIBGMP.
>>
>>    For conversion double->fraction, mpq seems overkill: Just multiply by
>>    a power of two to make the number an integer, to construct a fraction
>>    p / 2^k, and then eliminate any common factors of two (if fractions
>>    are required to be in some canonical form).
>
> Agreed.  I can easily reimplement this to avoid the mpq functions, and
> will do so.

Nice.  Could you look into it?  :-)

Thanks!

Ludo’.




This bug report was last modified 8 years and 217 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.