Skip Menu |

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

Report information
The Basics
Id: 110792
Status: resolved
Priority: 0/
Queue: Math-BigInt

Owner: Nobody in particular
Requestors: DANAJ [...]

Bug Information
Severity: Important
Broken in: 1.999712
Fixed in: 1.999713

Subject: new() not parsing float strings correctly.
Download (untitled) / with headers
text/plain 1.4k
Expected result: perl -Iblib/lib -Iblib/arch -E 'use Math::BigInt lib=>"Calc"; say Math::BigInt->new("716115441142293915.0000000000000000000000")' 716115441142293915 With 1.999712: perl -Iblib/lib -Iblib/arch -E 'use Math::BigInt lib=>"Calc"; say Math::BigInt->new("716115441142293915.0000000000000000000000")' 71611544114229000003915000000000000000000 $ perl -Iblib/lib -Iblib/arch -E 'use Math::BigInt lib=>"Pari"; say Math::BigInt->new("716115441142293915.0000000000000000000000")' 716115441142293915.000000000000000000000000000000000000000 $ perl -Iblib/lib -Iblib/arch -E 'use Math::BigInt lib=>"GMP"; say Math::BigInt->new("716115441142293915.0000000000000000000000")' 0 Note that neither of the two backends will pass tests so these results aren't too surprising. The old new() would call _new with $$miv, while the new new() calls with the complete input ($wanted). At a first glance, it looks like: if ($sgn) { $self->{value} = $CALC->_new($abs); } else { $self->{value} = $CALC->_new($wanted); } should be: $self->{value} = $CALC->_new($abs); That is, we don't want to pass in the .0* or the e0 or the sign -- just the number. This solves half the failing tests for Math::BigInt::GMP. The other half are because "infinity" is now allowed and they have tests that it is *not* allowed. Changing the two entries in and three in combined with the change above makes Math::BigInt::GMP 1.47 pass tests.
Download (untitled) / with headers
text/plain 111b
Oh my. This was a nasty bug. I will release a fix as soon as I can, hopefully at the very beginning of January.
Download (untitled) / with headers
text/plain 255b
I have included the fix provided by DANAJ (thanks!) in the newest release, version 1.999713. I guess this bug illustrates that the test suite is not good enough, but at least I have added a few test cases to the file t/ that catches this bug.
Fixed in v1.999713.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to