diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index cb317a42f..cbec87a8c 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -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}. @@ -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!! & Greater than\\ +\lstinline!>=! & Greater than or equal\\ +\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.