[libcxx-commits] [libcxx] [MLIR][Presburger] Define matrix inverse for rational matrices (PR #67382)
Arjun P via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 28 08:39:50 PDT 2023
================
@@ -102,7 +102,7 @@ inline bool operator>=(const Fraction &x, const Fraction &y) {
inline Fraction reduce(const Fraction &f) {
if (f == Fraction(0))
return Fraction(0, 1);
- MPInt g = gcd(f.num, f.den);
+ MPInt g = gcd(abs(f.num), abs(f.den));
return Fraction(f.num / g, f.den / g);
}
----------------
Superty wrote:
If this is a bug fix please submit it as a separate patch along with a test case.
https://github.com/llvm/llvm-project/pull/67382
More information about the libcxx-commits
mailing list