Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: peter.john.acklam [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 1.87
  • 1.88
  • 1.89
  • 1.90
  • 1.91
  • 1.92
  • 1.93
  • 1.94-TRIAL
  • 1.95
  • 1.96
  • 1.97
  • 1.98
  • 1.99
  • 1.99.1
  • 1.9902
  • 1.991
  • 1.992
  • 1.993
  • 1.997
  • 1.9993
  • 1.9994
  • 1.9995
  • 1.9996
  • 1.9997
  • 1.999701
  • 1.999702
  • 1.999703
  • 1.999704
  • 1.999705
  • 1.999706
  • 1.999707
  • 1.999708
  • 1.999709
  • 1.999710
  • 1.999712
  • 1.999713
  • 1.999714
  • 1.999715
  • 1.999716
  • 1.999717
  • 1.999718
  • 1.999719
  • 1.999720
  • 1.999721
  • 1.999722
  • 1.999723
  • 1.999724
  • 1.999725
  • 1.999726
  • 1.9997_11
  • 1.99_05
Fixed in: 1.999800



This bug has been around since Math-BigInt-1.87. The Math::BigInt::Calc method _root() sometimes gives incorrect result. The output should always be exact or truncated, i.e., rounded downwards, but when the exact result is close to an integer, _root() sometimes rounds upwards rather than downwards. Here are some cases that fails. Math::BigInt::Calc->_root(999999999, 9) gives 10, but should give 9 Math::BigInt::Calc->_root(16777215, 24) gives 2, but should give 1 Math::BigInt::Calc->_root(33554431, 25) gives 2, but should give 1 Math::BigInt::Calc->_root(67108863, 26) gives 2, but should give 1 Math::BigInt::Calc->_root(134217727, 27) gives 2, but should give 1 Math::BigInt::Calc->_root(268435455, 28) gives 2, but should give 1 Math::BigInt::Calc->_root(536870911, 29) gives 2, but should give 1