On Tue Dec 28 09:04:23 2010, pjacklam@online.no wrote: > The following standard definition is used: z is the modular inverse of > x (mod y) if and only if x*z (mod y) = 1 (mod y). > > - dist/Math-BigInt/lib/Math/BigInt.pm: Fix the code in bmodinv() so it > can > handle negative arguments. The code can be optimized further for > speed, > but correctnes first. > > - dist/Math-BigInt/t/bigintpm.inc: Fix the test case for modinv(-3, > -5). > The output should be -3, since -3 * -3 (mod -5) = -9 (mod -5) = -4, > and > 1 (mod -5) = -4. > > - dist/Math-BigRat/t/bigratpm.inc: Fix same test case as above. > Math::BigRat::bmodinv() only handles integers, and is essentially > just a > front-end to Math::BigInt::bmodinv(). > --- > dist/Math-BigInt/lib/Math/BigInt.pm | 97 > ++++++++++++++++++++++++++--------- > dist/Math-BigInt/t/bigintpm.inc | 2 +- > dist/Math-BigRat/t/bigratpm.inc | 2 +- > 3 files changed, 74 insertions(+), 27 deletions(-) Thank you. Applied as 487de07.