Re: [perl #56608] Math::BigInt gives completely when Math::BigInt::GMP is used
by Tels other posts by this author
Jul 5 2008 1:51AM messages near this date
Re: [perl #56608] Math::BigInt gives completely when Math::BigInt::GMP is used
|
Re: [perl #56608] Math::BigInt gives completely when Math::BigInt::GMP is used
On Saturday 05 July 2008 10:28:54 Bram wrote:
> Citeren Marc Lehmann <perlbug-followup@[...].org>:
> > -----------------------------------------------------------------
> > [Please enter your report here]
> >
> > When Math::BigInt uses GMP as backend, it gives completely bogus
> > results:
> >
> > perl -MMath::BigInt=lib,GMP -e 'my $b = 0xc0010203; my $m =
> > Math::BigInt->new (2) ** 24 - 1; warn $m + $b'
> > -105689855 at -e line 1.
> >
> > perl -MMath::BigInt=lib,GMP -e 'my $b = 0xc0010203; my $m =
> > Math::BigInt->new (2) ** 32 - 1; warn $m + $b'
> > 3221291522 at -e line 1.
> >
> > This only seems to happen with 32-bit perls.
I am pretty sure that is because the value is in-between treated as
signed vs. unsigned integer and thus arrives wrongly in libgmp.
Can you please run:
perl -Mbignum,l,GMP=v
?
All the best,
Tels
--
Signed on Sat Jul 5 10:50:08 2008 with key 0x93B84C15.
View my photo gallery: http://bloodgate.com/photos
PGP key on http://bloodgate.com/tels.asc or per email.
"Un bon mot ne prouve rien."
-- Voltaire
Thread:
Marc Lehmann
Bram
Matt Kraai
Tels
Tels
|