[poincare] Clean power implementation

Change-Id: I17f01cd7dc10a9864571c3fd76d44ff8da9b3fc0
This commit is contained in:
Émilie Feral
2017-04-05 17:41:21 +02:00
parent 8714bdba1d
commit f031bfdabd
2 changed files with 1 additions and 2 deletions

View File

@@ -3,7 +3,6 @@ extern "C" {
#include <stdlib.h>
}
#include <poincare/matrix_data.h>
#include <poincare/integer.h>
namespace Poincare {

View File

@@ -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()) {