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

Commit

Permalink
[cppruntime] Adapted zero function tolerance
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #2829
  • Loading branch information
niklwors authored and OpenModelica-Hudson committed Dec 14, 2018
1 parent 7a31ea6 commit 3fa798f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -12339,30 +12339,30 @@ template giveZeroFunc3(Integer index1, Exp relation, Text &varDecls /*BUFP*/,Tex
case LESS(__) then
<<
if(_conditions[<%zerocrossingIndex%>])
f[<%index1%>]=(<%e1%> - 1e-9 - <%e2%>);
f[<%index1%>]=(<%e1%> - 1e-6 - <%e2%>);
else
f[<%index1%>]=(<%e2%> - <%e1%> - 1e-9);
f[<%index1%>]=(<%e2%> - <%e1%> - 1e-6);
>>
case LESSEQ(__) then
<<
if(_conditions[<%zerocrossingIndex%>])
f[<%index1%>] = (<%e1%> - 1e-9 - <%e2%>);
f[<%index1%>] = (<%e1%> - 1e-6 - <%e2%>);
else
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-9);
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-6);
>>
case GREATER(__) then
<<
if(_conditions[<%zerocrossingIndex%>])
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-9);
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-6);
else
f[<%index1%>] = (<%e1%> - 1e-9 - <%e2%>);
f[<%index1%>] = (<%e1%> - 1e-6 - <%e2%>);
>>
case GREATEREQ(__) then
<<
if(_conditions[<%zerocrossingIndex%>])
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-9);
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-6);
else
f[<%index1%>] = (<%e1%> - 1e-9 - <%e2%>);
f[<%index1%>] = (<%e1%> - 1e-6 - <%e2%>);
>>
else
<<
Expand Down

0 comments on commit 3fa798f

Please sign in to comment.