Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be clearer in definition of Inf and avoid relying on Modelica.Constants. #3612

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ \subsubsection{Reduction Expressions}\label{reduction-expressions}
For deduction of ranges, see \cref{implicit-iteration-ranges}; and for using types as ranges see \cref{types-as-iteration-ranges}.

\begin{table}[H]
\caption{Reduction expressions with iterators. (The least and greatest values of \lstinline!Real! are available as \lstinline!-Modelica.Constants.inf! and \lstinline!Modelica.Constants.inf!, respectively.)}
\caption{Reduction expressions with iterators.}
\begin{center}
\begin{tabular}{l l l}
\hline
Expand All @@ -612,6 +612,8 @@ \subsubsection{Reduction Expressions}\label{reduction-expressions}
\end{center}
\end{table}

The least and greatest values of \lstinline!Real! are the minimum and maximum representable finite floating point numbers of the underlying type, see also \cref{real-type}.

\begin{example}
% No frame since the math would break it.
\begin{lstlisting}[language=modelica, frame=none]
Expand Down
8 changes: 7 additions & 1 deletion chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ \subsection{Real Type}\label{real-type}
parameter StringType quantity = "";
parameter StringType unit = "" "Unit used in equations";
parameter StringType displayUnit = "" "Default display unit";
parameter RealType min = -Inf, max = +Inf; // Inf denotes a large value
parameter RealType min = ..., max = ...; // See below
parameter RealType start; // Initial value
parameter BooleanType fixed = true, // default for parameter/constant;
= false; // default for other variables
Expand All @@ -1500,6 +1500,12 @@ \subsection{Real Type}\label{real-type}
\index{unbounded@\robustinline{unbounded}!attribute of \robustinline{Real}}%
\index{stateSelect@\robustinline{stateSelect}!attribute of \robustinline{Real}}

The default \lstinline!max! and \lstinline!max!-attributes are the minimum and maximum representable finite floating point number of the underlying type.
Therefore they do not constrain the value.
\begin{nonnormative}
The minimum representable floating point number is usually minus the maximum representable floating point number, and should not be confused with the minimum positive one.
\end{nonnormative}

The following attributes shall be evaluable: \lstinline!quantity!, \lstinline!unit!, \lstinline!displayUnit!, \lstinline!fixed!, and \lstinline!stateSelect!.

The \lstinline!unit!- and \lstinline!displayUnit!-attributes may be either the empty string or a string matching \lstinline[language=grammar]!unit-expression! in \cref{unit-expressions}.
Expand Down