Skip to content

Commit

Permalink
Change small tables of arithmetic operators from 'longtable' to 'tabu…
Browse files Browse the repository at this point in the history
…lar'

This removes the last uses of 'longtable' in this chapter.
  • Loading branch information
henrikt-ma committed Sep 18, 2020
1 parent cf98b02 commit 8a82fda
Showing 1 changed file with 34 additions and 20 deletions.
54 changes: 34 additions & 20 deletions chapters/operatorsandexpressions.tex
Expand Up @@ -140,15 +140,20 @@ \subsection{Example: Guarding Expressions Against Incorrect Evaluation}\label{ex

\section{Arithmetic Operators}\label{arithmetic-operators}

Modelica supports five binary arithmetic operators that operate on any
numerical type:
\begin{longtable}[c]{ll}
Modelica supports five binary arithmetic operators that operate on any numerical type:
\begin{center}
\begin{tabular}{c|l}
\tablehead{Operator} & \tablehead{Description} \\
\hline
\hline
\lstinline!^! & Exponentiation\\
\lstinline!*! & Multiplication\\
\lstinline!/! & Division\\
\lstinline!+! & Addition\\
\lstinline!-! & Subtraction\\
\end{longtable}
\hline
\end{tabular}
\end{center}

Some of these operators can also be applied to a combination of a scalar
type and an array type, see \cref{scalar-vector-matrix-and-array-operator-functions}.
Expand All @@ -174,29 +179,38 @@ \section{Arithmetic Operators}\label{arithmetic-operators}

\section{Equality, Relational, and Logical Operators}\label{equality-relational-and-logical-operators}

Modelica supports the standard set of relational and logical operators,
all of which produce the standard boolean values \lstinline!true! or \lstinline!false!.


\begin{longtable}[]{ll}
\lstinline!>! & greater than\\
\lstinline!>=! & greater than or equal\\
\lstinline!<! & less than\\
\lstinline!<=! & less than or equal to\\
\lstinline!==! & equality within expressions\\
Modelica supports the standard set of relational and logical operators, all of which produce the standard boolean values \lstinline!true! or \lstinline!false!:
\begin{center}
\begin{tabular}{c|l}
\tablehead{Operator} & \tablehead{Description} \\
\hline
\hline
\lstinline!>! & Greater than\\
\lstinline!>=! & Greater than or equal\\
\lstinline!<! & Less than\\
\lstinline!<=! & Less than or equal to\\
\lstinline!==! & Equality within expressions\\
\lstinline!<>! & Inequality\\
\end{longtable}
\hline
\end{tabular}
\end{center}

A single equals sign \lstinline!=! is never used in relational expressions, only in
equations (\cref{equations}, \cref{equality-and-assignment}) and in function calls using named
parameter passing (\cref{positional-or-named-input-arguments-of-functions}).

The following logical operators are defined:
\begin{longtable}[]{ll}
\lstinline!not! & negation, unary operator\\
\lstinline!and! & logical and\\
\lstinline!or! & logical or\\
\end{longtable}
\begin{center}
\begin{tabular}{c|l}
\tablehead{Operator} & \tablehead{Description} \\
\hline
\hline
\lstinline!not! & Logical negation (unary operator)\\
\lstinline!and! & Logical \emph{and} (conjunction)\\
\lstinline!or! & Logical \emph{or} (disjunction)\\
\hline
\end{tabular}
\end{center}

The grammar rules define the syntax of the relational and logical
operators.
Expand Down

0 comments on commit 8a82fda

Please sign in to comment.