Skip to content

Commit

Permalink
Clean up whitespace in listing related to pure functions
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Oct 11, 2020
1 parent c6be989 commit b1d96f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@ \section{Pure Modelica Functions}\label{pure-modelica-functions}

Examples of restrictions on optimizing pure functions:
\begin{lstlisting}[language=modelica]
Real x=if noEvent(abs(x))<1 then asin(x) else 0; // May not move asin(x) out of then
Real x = if noEvent(abs(x)) < 1 then asin(x) else 0; // May not move asin(x) out of then
algorithm
assertCheck(p, T); // Must call function
algorithm
if b then
y:=2*someOtherFunction(x);
y := 2 * someOtherFunction(x);
end if;
y:=y+asin(x);
y:=y+someOtherFunction(x);
y := y + asin(x);
y := y + someOtherFunction(x);
// May not evaluate someOtherFunction(x) before asin(x) - unless b is true
// The reason is that asin(x) may fail and someOtherFunction may hang,
// and it might be possible to recover from this error.
Expand Down

0 comments on commit b1d96f9

Please sign in to comment.