Skip Menu |
 

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

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

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

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



Subject: Possible infinite loop inside Math::BigFloat->batan2()
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-13448-1450500346-1984.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 474
Download (untitled) / with headers
text/plain 474b
Given the following code: ===BEGIN=== use Math::BigFloat (lib => 'GMP'); my $x = Math::BigFloat->new('0.08628308027'); my $y = Math::BigFloat->new('0.008726535033'); CORE::say $x->batan2($y); ===END=== On my computer, with Math::BigInt::GMP installed, after two minutes, the code is still running. My guess is that it got stuck into an infinite loop, or the function is just too slow to finish in a reasonable amount of time. I'm not really sure which one is the case.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-13448-1450500346-1984.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-13448-1450500346-1984.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-2491-1451994287-91.110445-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 349
Download (untitled) / with headers
text/plain 349b
With Math-BigInt v1.999714, my laptop takes less than a fraction of a execute the code and return 1.4700006461650417615358745908443378854551204. Thanks to DANAJ (Dana Jacobsen) for the fix and for the suggestions for speeding up the code. The batan2() method was almost completely rewritten. If it returned a result, the result was often incorrect.


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.