From 9e0f7bedd46886aa07a768bd6bcb00630c5e1dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 30 May 2018 10:31:11 +0200 Subject: [PATCH] [poincare] Rational Power: always reduce p^(-1) if p rational Otherwise, it causes bug when trying to reduce to same denominator. For example: In Calculation app, type: '6' OK, 'Y-ans/(ans*ans*ans*ans*ans), OK OK OK OK --> crash --- poincare/src/power.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/poincare/src/power.cpp b/poincare/src/power.cpp index 6531d27d6..49f9504c5 100644 --- a/poincare/src/power.cpp +++ b/poincare/src/power.cpp @@ -821,6 +821,9 @@ bool Power::isNthRootOfUnity() const { } bool Power::RationalExponentShouldNotBeReduced(const Rational * b, const Rational * r) { + if (r->isMinusOne()) { + return false; + } /* We check that the simplification does not involve too complex power of * integers (ie 3^999, 120232323232^50) that would take too much time to * compute: