From 6f45fa2351146b4df22c847f4ddbc21c7de326f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 27 Sep 2018 14:39:53 +0200 Subject: [PATCH] [poincare] Fix Power with variable-length symbols --- poincare/src/power.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poincare/src/power.cpp b/poincare/src/power.cpp index b48fbf826..d2b59bcb9 100644 --- a/poincare/src/power.cpp +++ b/poincare/src/power.cpp @@ -898,7 +898,7 @@ bool Power::parentIsALogarithmOfSameBase() const { bool Power::isNthRootOfUnity() const { // We check we are equal to e^(i*pi) or e^(i*pi*rational) - if (childAtIndex(0).type() != ExpressionNode::Type::Symbol || childAtIndex(0).convert().name() != Ion::Charset::Exponential) { + if (childAtIndex(0).type() != ExpressionNode::Type::Symbol || !childAtIndex(0).convert().isExponential()) { return false; } if (childAtIndex(1).type() != ExpressionNode::Type::Multiplication) { @@ -908,11 +908,11 @@ bool Power::isNthRootOfUnity() const { return false; } const Expression i = childAtIndex(1).childAtIndex(childAtIndex(1).numberOfChildren()-1); - if (i.type() != ExpressionNode::Type::Symbol || static_cast(i).name() != Ion::Charset::IComplex) { + if (i.type() != ExpressionNode::Type::Symbol || !static_cast(i).isIComplex()) { return false; } const Expression pi = childAtIndex(1).childAtIndex(childAtIndex(1).numberOfChildren()-2); - if (pi.type() != ExpressionNode::Type::Symbol || static_cast(pi).name() != Ion::Charset::SmallPi) { + if (pi.type() != ExpressionNode::Type::Symbol || !static_cast(pi).isPi()) { return false; } if (numberOfChildren() == 2) {