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