From f031bfdabd6cac58d505bc7c63ff5ec7ffdc3ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 5 Apr 2017 17:41:21 +0200 Subject: [PATCH] [poincare] Clean power implementation Change-Id: I17f01cd7dc10a9864571c3fd76d44ff8da9b3fc0 --- poincare/src/matrix_data.cpp | 1 - poincare/src/power.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/poincare/src/matrix_data.cpp b/poincare/src/matrix_data.cpp index 49a89c001..e5506a431 100644 --- a/poincare/src/matrix_data.cpp +++ b/poincare/src/matrix_data.cpp @@ -3,7 +3,6 @@ extern "C" { #include } #include -#include namespace Poincare { diff --git a/poincare/src/power.cpp b/poincare/src/power.cpp index 971bcef12..f94c6796d 100644 --- a/poincare/src/power.cpp +++ b/poincare/src/power.cpp @@ -52,7 +52,7 @@ Expression * Power::evaluateOnComplex(Complex * c, Complex * d, Context& context } Expression * Power::evaluateOnMatrixAndComplex(Matrix * m, Complex * c, Context& context, AngleUnit angleUnit) const { - if (m_operands[1]->type() != Expression::Type::Integer) { + if (isnan(m_operands[1]->approximate(context, angleUnit)) || m_operands[1]->approximate(context, angleUnit) != (int)m_operands[1]->approximate(context, angleUnit)) { return new Complex(Complex::Float(NAN)); } if (m->numberOfColumns() != m->numberOfRows()) {