Skip Menu |

This queue is for tickets about the bignum CPAN distribution.

Report information
The Basics
Id: 66591
Status: resolved
Priority: 0/
Queue: bignum

People
Owner: Nobody in particular
Requestors: tee.bee [...] gmx.de
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.25
Fixed in: (no value)



Subject: bignum's logarithm function fails for accuracy > 70
The first call to bignum's logarithm function blog returns a wrong result for some arguments if the accuracy is greater than 70. However, subsequent calls seem to work correctly. $ uname -a Linux xxx 2.6.32-29-generic #58-Ubuntu SMP Fri Feb 11 19:00:09 UTC 2011 i686 GNU/Linux $ perl -v|perl -p00e'last}{' This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi $ perl -Mbignum=v bignum v0.25 Math::BigInt v1.95 lib => Math::BigInt::FastCalc v0.22 Math::BigFloat v1.62 base == Euler's number e: $ perl -Mbignum=a,70 -le'print 11->blog(),$/,11->blog(),$/,11->blog()' 2.397895272798370544061943577965129299821706853937417175218567709130574 2.397895272798370544061943577965129299821706853937417175218567709130574 2.397895272798370544061943577965129299821706853937417175218567709130574 $ perl -Mbignum=a,71 -le'print 11->blog(),$/,11->blog(),$/,11->blog()' 3.0910424533583158534791756994233058678972069882976724293392477186239672 2.3978952727983705440619435779651292998217068539374171752185677091305736 2.3978952727983705440619435779651292998217068539374171752185677091305736 base == 2: $ perl -Mbignum=a,70 -le'print 11->blog(2),$/,11->blog(2),$/,11->blog(2)' 3.459431618637297256199363046725792958703231525681768071312801645726331 3.459431618637297256199363046725792958703231525681768071312801645726331 3.459431618637297256199363046725792958703231525681768071312801645726331 $ perl -Mbignum=a,71 -le'print 11->blog(2),$/,11->blog(2),$/,11->blog(2)' 4.4594316186372972561993630467257929587032315256817680713128016457263306 3.4594316186372972561993630467257929587032315256817680713128016457263306 3.4594316186372972561993630467257929587032315256817680713128016457263306
Thank you for your report. This is essentially the same bug as RT 43692, https://rt.cpan.org/Public/Bug/Display.html?id=43692 I have started working on a fix, but I have no estimate of a release date.
Fixed in latest BigFloat (1.9996), though that isn't on CPAN yet. With Perl 5.21.2: $ perl -Mbignum=a,71 -le'print 11->blog(),$/,11->blog(),$/,11->blog()' 2.3978952727983705440619435779651292998217068539374171752185677091305736 2.3978952727983705440619435779651292998217068539374171752185677091305736 2.3978952727983705440619435779651292998217068539374171752185677091305736 $ perl -Mbignum=a,71 -le'print 11->blog(2),$/,11->blog(2),$/,11->blog(2)' 3.4594316186372972561993630467257929587032315256817680713128016457263306 3.4594316186372972561993630467257929587032315256817680713128016457263306 3.4594316186372972561993630467257929587032315256817680713128016457263306
Fixed in Math-BigInt-1.9994.