Skip to content

Commit de84246

Browse files
authored
Do not simplify n*n=n^2.0 when n is an integer (#693)
https://trac.openmodelica.org/OpenModelica/ticket/5715
1 parent 0a8d7d7 commit de84246

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

OMCompiler/Compiler/FrontEnd/ExpressionSimplify.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,7 @@ algorithm
21862186
(lstConstExp, lstExp) = List.splitOnTrue(lstExp, Expression.isConst);
21872187
if not listEmpty(lstConstExp) then
21882188
resConst = simplifyBinaryMulConstants(lstConstExp);
2189-
exp_2 = Expression.makeProductLst(simplifyMul(lstExp));
2189+
exp_2 = Expression.makeProductLst(if Types.isScalarReal(Expression.typeofOp(op)) then simplifyMul(lstExp) else lstExp);
21902190
if Expression.isConstOne(resConst) then
21912191
exp_3 = simplify2(exp_2, true, false);
21922192
elseif Expression.isConstMinusOne(resConst) then

0 commit comments

Comments
 (0)