Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit f440207

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Real range fixes.
- Fix constant evaluation of real ranges. - Expand expressions in SimplifyExp.simplifyBinaryOp before delegating to Ceval.evalBinaryOp, since Ceval.evalBinaryOp doesn't handle ranges. Belonging to [master]: - #2981
1 parent 2f5968b commit f440207

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Compiler/NFFrontEnd/NFCeval.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ algorithm
753753
result := {Expression.REAL(start)};
754754
else
755755
result := {Expression.REAL(stop)};
756-
for i in steps-1:-1:1 loop
756+
for i in steps-2:-1:1 loop
757757
result := Expression.REAL(start + i * step) :: result;
758758
end for;
759759
result := Expression.REAL(start) :: result;

Compiler/NFFrontEnd/NFSimplifyExp.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ function simplifyBinaryOp
398398
import NFOperator.Op;
399399
algorithm
400400
if Expression.isLiteral(exp1) and Expression.isLiteral(exp2) then
401-
outExp := Ceval.evalBinaryOp(exp1, op, exp2);
401+
outExp := Ceval.evalBinaryOp(ExpandExp.expand(exp1), op, ExpandExp.expand(exp2));
402402
else
403403
outExp := match op.op
404404
case Op.ADD then simplifyBinaryAdd(exp1, op, exp2);

0 commit comments

Comments
 (0)