1113 |
BigInteger rem = new BigInteger(); |
BigInteger rem = new BigInteger(); |
1114 |
BigInteger quot = new BigInteger(); |
BigInteger quot = new BigInteger(); |
1115 |
divide(a, b, quot, rem, FLOOR); |
divide(a, b, quot, rem, FLOOR); |
1116 |
|
// quot and rem may not be in canonical form. ensure |
1117 |
|
rem.canonicalize(); |
1118 |
|
quot.canonicalize(); |
1119 |
xy = euclidInv(b, rem, quot); |
xy = euclidInv(b, rem, quot); |
1120 |
} |
} |
1121 |
|
|
1195 |
BigInteger rem = new BigInteger(); |
BigInteger rem = new BigInteger(); |
1196 |
BigInteger quot = new BigInteger(); |
BigInteger quot = new BigInteger(); |
1197 |
divide(x, y, quot, rem, FLOOR); |
divide(x, y, quot, rem, FLOOR); |
1198 |
|
// quot and rem may not be in canonical form. ensure |
1199 |
|
rem.canonicalize(); |
1200 |
|
quot.canonicalize(); |
1201 |
result = euclidInv(y, rem, quot)[swapped ? 0 : 1]; |
result = euclidInv(y, rem, quot)[swapped ? 0 : 1]; |
1202 |
|
|
1203 |
// Result can't be negative, so make it positive by adding the |
// Result can't be negative, so make it positive by adding the |