[poincare/matrix_identity] Fix shallowReduce

This commit is contained in:
Léa Saviot
2019-08-02 11:29:59 +02:00
committed by Émilie Feral
parent db1eb1072f
commit cdbcc3c6bc

View File

@@ -49,7 +49,9 @@ Expression MatrixIdentity::shallowReduce(ExpressionNode::ReductionContext reduct
}
}
Expression c = childAtIndex(0);
if (!c.isRationalOne()) {
if (c.type() != ExpressionNode::Type::Rational
|| !static_cast<Rational&>(c).isInteger())
{
return replaceWithUndefinedInPlace();
}
Integer dimension = static_cast<Rational &>(c).signedIntegerNumerator();