Skip Menu |

This queue is for tickets about the Math-GMPf CPAN distribution.

Report information
The Basics
Id: 52082
Status: resolved
Priority: 0/
Queue: Math-GMPf

People
Owner: Nobody in particular
Requestors: kmx [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Failing test - Rmpf_eq (with gmp 4.3.2 dev release)
Hi, I have just tested Math::GMPf 0.29 with dev release of GMP (4.3.2 candidate) and found a problem with failing test: - t\test1.t - test 18 = Rmpf_eq($q, $r, 96) The interesting is that this test pass with last parameter values <=94 and fail for value 95 and higher. There seem to be some changes in GMP's implementation of function mpf_eq() since GMP 4.3.1 and it may cause this problem. Could you please give me a short feedback if you see it as a GMPlib problem or as a Math::GMPf problem. Thanks. -- kmx
RT-Send-CC: kmx [...] cpan.org
On Thu Nov 26 04:22:55 2009, KMX wrote: Show quoted text
> Hi, > > I have just tested Math::GMPf 0.29 with dev release of GMP (4.3.2 > candidate) and found a problem with failing test: > - t\test1.t > - test 18 = Rmpf_eq($q, $r, 96) > > The interesting is that this test pass with last parameter values <=94 > and fail for value 95 and higher. > > There seem to be some changes in GMP's implementation of function > mpf_eq() since GMP 4.3.1 and it may cause this problem. > > Could you please give me a short feedback if you see it as a GMPlib > problem or as a Math::GMPf problem. >
Math::GMPf should faithfully copy the behaviour of the gmp library against which it has been built. That is, perl's "Rmpf_eq($q, $r, $bits)" should return the same as C's "mpf_eq(q, r, bits)". If there has been a change to mpf_eq(), then it may be that test 18 needs to be rewritten to accommodate that change - but I probably ought to take a look at the 4.3.2 dev distro you've been using. Where do I get it ? Cheers, Rob
Subject: Re: [rt.cpan.org #52082] Failing test - Rmpf_eq (with gmp 4.3.2 dev release)
Date: Thu, 26 Nov 2009 12:27:42 +0100
To: bug-Math-GMPf [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Hi Rob, I am using GMP binaries that are part of mingw-w64 gcc-toolchain binaries provided by sezero (you might remember those :). See enclosed patch that was applied to gmplib. -- kmx Show quoted text
> Math::GMPf should faithfully copy the behaviour of the gmp library > against which it has been built. That is, perl's "Rmpf_eq($q, $r, > $bits)" should return the same as C's "mpf_eq(q, r, bits)". > If there has been a change to mpf_eq(), then it may be that test 18 > needs to be rewritten to accommodate that change - but I probably ought > to take a look at the 4.3.2 dev distro you've been using. Where do I > get it ? > > Cheers, > Rob
Download gmp-4.3.2-dev.diff.zip
application/octet-stream 5.5k

Message body not shown because it is not plain text.

RT-Send-CC: kmx [...] volny.cz
On Thu Nov 26 06:28:10 2009, kmx@volny.cz wrote: Show quoted text
> Hi Rob, > > I am using GMP binaries that are part of mingw-w64 gcc-toolchain > binaries provided by sezero (you might remember those :).
Indeed I do :-) In test 18, the precision of both $q and $r is 64 - and I'm thinking it's a bit dubious to be testing whether the first 96 bits of two 64- bit numbers are identical or not. Testing that "Rmpf_eq($q, $r, 64)" returns true would seem to be a more sensible test to conduct, and would solve the problem, I believe. Does that sound reasonable ? Cheers, Rob
Subject: [SPAM] Re: [rt.cpan.org #52082] Failing test - Rmpf_eq (with gmp 4.3.2 dev release)
Date: Fri, 27 Nov 2009 11:31:40 +0100
To: bug-Math-GMPf [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Show quoted text
> In test 18, the precision of both $q and $r is 64 - and I'm thinking > it's a bit dubious to be testing whether the first 96 bits of two 64- > bit numbers are identical or not. Testing that "Rmpf_eq($q, $r, 64)" > returns true would seem to be a more sensible test to conduct, and > would solve the problem, I believe. > > Does that sound reasonable ? >
Yes - "Rmpf_eq($q, $r, 64)" - works. Thanks. -- kmx
RT-Send-CC: kmx [...] volny.cz
On Fri Nov 27 05:32:00 2009, kmx@volny.cz wrote: Show quoted text
> Yes - "Rmpf_eq($q, $r, 64)" - works.
I'll change it to that in the next release of Math::GMPf (and close this bug report when that "next release" is released). Thanks for raising this. Cheers, Rob
This should be fixed in 0.30. (Meant to close this ticket when 0.30 was released ... but forgot, until now.) Cheers, Rob