diff --git a/poincare/src/matrix_identity.cpp b/poincare/src/matrix_identity.cpp index c015030d8..6cadf5968 100644 --- a/poincare/src/matrix_identity.cpp +++ b/poincare/src/matrix_identity.cpp @@ -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(c).isInteger()) + { return replaceWithUndefinedInPlace(); } Integer dimension = static_cast(c).signedIntegerNumerator();