| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Math::BigRat was trying to copy the sign of a BigRat object into a
BigInt object when converting to an integer, but without taking into
account that the number might be rounded toward zero. This resulted
in a 0 BigInt with a negative sign, which is not actually a valid
BigInt object, as it does not support negative zero.
|
| |
|
|
|
|
| |
release per cmpVERSION.pl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend bmodpow() to handle negative numbers.
- dist/Math-BigInt/lib/Math/BigInt.pm: Fix bmodpow() code and make the
documentation style more like that of other methods.
- dist/Math-BigInt/t/bigintpm.inc: Edit test results so they match new
behaviour, i.e., where earlier a NaN was returned, there are now
some cases where an integer is returned, since bmodpow() now also
handles negative numbers. Also include test cases from RT 63237. The
tests themselves have all been verified to be correct using other
software.
- dist/Math-BigRat/t/bigratpm.inc: Fix test case so it matches the new
behaviour of Math::BigInt->bmodinv(). Math::BigRat->bmodinv() only
handles integers, and is essentially just a front-end to
Math::BigInt->bmodinv().
- dist/Math-BigInt/t/bare_mbi.t: Increment test count.
- dist/Math-BigInt/t/bigintpm.t: Increment test count.
- dist/Math-BigInt/t/sub_mbi.t: Increment test count.
|
|
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81888]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81888 >
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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().
|
| |
|
|
|
|
|
|
| |
Some of them used to return wrong results, others just failed horribly. We're
disabling them alltogether, with a useful error message, until maybe someone
figures out how to make them DWIM.
|
|
|