From cdbcc3c6bca69859d025d16ee82386b924678935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Fri, 2 Aug 2019 11:29:59 +0200 Subject: [PATCH] [poincare/matrix_identity] Fix shallowReduce --- poincare/src/matrix_identity.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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();