Skip to content

Commit

Permalink
Do not simplify n*n=n^2.0 when n is an integer (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Jan 29, 2020
1 parent 0a8d7d7 commit de84246
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/FrontEnd/ExpressionSimplify.mo
Expand Up @@ -2186,7 +2186,7 @@ algorithm
(lstConstExp, lstExp) = List.splitOnTrue(lstExp, Expression.isConst);
if not listEmpty(lstConstExp) then
resConst = simplifyBinaryMulConstants(lstConstExp);
exp_2 = Expression.makeProductLst(simplifyMul(lstExp));
exp_2 = Expression.makeProductLst(if Types.isScalarReal(Expression.typeofOp(op)) then simplifyMul(lstExp) else lstExp);
if Expression.isConstOne(resConst) then
exp_3 = simplify2(exp_2, true, false);
elseif Expression.isConstMinusOne(resConst) then
Expand Down

0 comments on commit de84246

Please sign in to comment.