From ad61954aa22b027deac080c2477a3da40bb5f87e Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Sun, 17 Apr 2022 23:35:45 -0700 Subject: [PATCH] rational: don't try to reduce when denom == 1 Fixes #1895 (and probably several other issues when using -O2 on ARM64 systems) --- app/common/rational.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/rational.cpp b/app/common/rational.cpp index 9aa20426c..34d627572 100644 --- a/app/common/rational.cpp +++ b/app/common/rational.cpp @@ -72,7 +72,7 @@ void rational::fix_signs() void rational::reduce() { - if (!isNull()) { + if (!isNull() && denom_ != 1) { // Euclidean often fails if numbers are negative, we abs it and re-neg it later if necessary bool neg = numer_ < 0;