[poincare/matrix_id] If child not rational, return this in shallowRed

Example: matrix_identity(cosh(0))
This commit is contained in:
Léa Saviot
2019-08-20 11:51:30 +02:00
parent 0c28796e85
commit fe0904cd8c

View File

@@ -52,7 +52,7 @@ Expression MatrixIdentity::shallowReduce(ExpressionNode::ReductionContext reduct
if (c.type() != ExpressionNode::Type::Rational
|| !static_cast<Rational&>(c).isInteger())
{
return replaceWithUndefinedInPlace(); // TODO: are we sure?
return *this;
}
Integer dimension = static_cast<Rational &>(c).signedIntegerNumerator();
if (dimension.isNegative()) {