[perl #81400] Fix bmodinv() part of RT 63237
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().