Log for attempted build of libmath-mpfr-perl_3.17-1 on m68k (dist=unstable)

sisyphus1 at optusnet.com.au sisyphus1 at optusnet.com.au
Sun May 5 03:03:18 UTC 2013



-----Original Message----- 
From: sisyphus1 at optusnet.com.au


>
> 10 minutes later and I think I have a solution.
> Instead of doing:
> Rmpfr_printf("%Pu\n", Rmpfr_get_prec($op);
>
> I can document that we must do:
> Rmpfr_printf("%Pu\n", prec_cast(Rmpfr_get_prec($op));
>
> where prec_cast() returns an object that encapsulates an actual 
> mpfr_prec_t.
> Then I also change the s/sn/f/printf functions so that, if they receive 
> one of these objects, then the first thing they do is to extract the 
> mpfr_prec_t value from that object and pass that extracted mpfr_prec_t 
> value on.
>
> That involves a bit of XS coding ... but at least it should work 
> everywhere ... assuming that one can do everywhere (eg):
>
> IV a = 24687;
> mpfr_prec_t b = (mpfr_prec_t) a;
>
> and have 'b' contain a value of 24687.
>
> I guess there'll be a compiler warning (about possible loss of precision) 
> associated with that whenever the IV is larger than the mpfr_prec_t, but 
> it should still work as expected, shouldn't it ?
>
> Anyway, I'll get to it, and see how it goes.
>

Ok - that's all done.
I probably should check that the cast from IV (long long) to mpfr_prec_t has 
the desired result.

/*******************************/
#include <stdio.h>
#include <mpfr.h>

int main(void) {
unsigned long long x = 80LL;
unsigned long long y = 24687LL;

mpfr_printf("precision of x: %Pu\n", (mpfr_prec_t)x);
mpfr_printf("precision of x: %Pu\n", (mpfr_prec_t)y);

return 0;
}

/*******************************/

Hopefully that will report precisons of 80 and 24687 respectively. 
(Otherwise, I really struggle to understand what's going wrong.)

I still want to write a test script for this (for inclusion in the 
Math::MPFR test suite.)
Once that's done, would you like a 3.18 release ?
(Since 3.17 was released, I've also added a fix for an mpfr bug in 
mpfr_fits_uint_p.)

Cheers,
Rob 




More information about the pkg-perl-maintainers mailing list