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

Commit

Permalink
correctly compare mod() and div() zerocrossing pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
hkiel authored and OpenModelica-Hudson committed May 12, 2017
1 parent 2f4a409 commit a342dab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Compiler/BackEnd/ZeroCrossings.mo
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ algorithm
case (BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("ceil"), expLst={e1, _})), BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("ceil"), expLst={e2, _})))
then Expression.compare(e1,e2);

case (BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("mod"), expLst={e1, e2, _})), BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("mod"), expLst={_, e4, _})))
case (BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("mod"), expLst={e1, e2, _})), BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("mod"), expLst={e3, e4, _})))
algorithm
comp := Expression.compare(e1,e2);
comp := Expression.compare(e1,e3);
then if comp==0 then Expression.compare(e2, e4) else comp;

case (BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("div"), expLst={e1, e2, _})), BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("div"), expLst={_, e4, _})))
case (BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("div"), expLst={e1, e2, _})), BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("div"), expLst={e3, e4, _})))
algorithm
comp := Expression.compare(e1,e2);
comp := Expression.compare(e1,e3);
then if comp==0 then Expression.compare(e2, e4) else comp;

case (BackendDAE.ZERO_CROSSING(relation_=e1), BackendDAE.ZERO_CROSSING(relation_=e2))
Expand Down

0 comments on commit a342dab

Please sign in to comment.