On Wed Dec 22 10:48:47 2010, pjacklam@online.no wrote: > Why: The Math::BigFloat->bcmp() method returns the wrong result when > the > exponent is too large to be represented exactly as a Perl numerical > scalar. In such cases, bcmp() returns 0 because it fails to > distinguish > between the two exponents. > > How: With this fix, bcmp() does not convert the exponents to Perl > numerical scalars, but keeps them as arbitrary precision integers, > thus > returning the correct result regardsless of the number of digits in > the > exponent. > > Test: Two tests added. These tests fail with the old code. > > Files: > > - lib/Math/BigFloat.pm: New version of bcmp(). > > - t/bigfltpm.inc: Add two tests confirming desired behaviour. > > - t/bare_mbf.t: Increment test count. > > - t/bigfltpm.t: Increment test count. > > - t/sub_mbf.t: Increment test count. > > - t/with_sub.t Increment test count. > --- > dist/Math-BigInt/lib/Math/BigFloat.pm | 189 > ++++++++++++++++++++++++--------- > dist/Math-BigInt/t/bare_mbf.t | 2 +- > dist/Math-BigInt/t/bigfltpm.inc | 2 + > dist/Math-BigInt/t/bigfltpm.t | 2 +- > dist/Math-BigInt/t/sub_mbf.t | 2 +- > dist/Math-BigInt/t/with_sub.t | 2 +- > 6 files changed, 147 insertions(+), 52 deletions(-) > Thank you. Applied as aa45dafa.