|
Posted by gamo on March 29, 2006, 5:53 am
Please log in for more thread options
On Wed, 29 Mar 2006, Sisyphus wrote:
> ----------------------------------------------------------------------------
> -----
>
> Although both of your combi() subroutines calculate the same values for both
> $nn and $mm (which you can verify with appropriate print statements), the
> "bignum" version of combi() miscalculates $r - while the GMP::Mpz version of
> combi() calculates $r correctly. (Again you can verify that the returns are
> different by simply 'print $r;'.)
>
> I don't know why bignum gets it wrong - but you could let the author know
> about the bug. (Try to create a simpler demo for him, however - or at least
> tell him that the problem is with the calculation of $r, rather than making
> him work that out for himself.) Personally, if I wanted to use pure perl
> biginteger routines I would just 'use Math::BigInt;' rather than 'use
> bignum;'. If you did switch to 'use Math::BigInt;' I think you would find
> that the bug goes away - yielding a correct answer.
>
> But .... if I had GMP::Mpz (which I do) or any other XS interface to the GMP
> library (which I also do) then I wouldn't even want to use "pure perl
> biginteger routines" at all :-)
>
> Cheers,
> Rob
>
Thank you very much for your help, in many times.
Cheers
|