Skip to content

Commit

Permalink
Move details/recommendations for RealType and IntegerType to where th…
Browse files Browse the repository at this point in the history
…ey belong

Fixes modelica#2552
  • Loading branch information
henrikt-ma committed Jun 12, 2020
1 parent 8e12fc9 commit 2f9219d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
15 changes: 8 additions & 7 deletions chapters/classes.tex
Expand Up @@ -1474,9 +1474,14 @@ \subsection{Real Type}\doublelabel{real-type}
end Real;
\end{lstlisting}

The nominal attribute is meant to be used for scaling purposes and to
The \lstinline!nominal! attribute is meant to be used for scaling purposes and to
define tolerances in relative terms, see \autoref{attributes-start-fixed-nominal-and-unbounded}.

\begin{nonnormative}
For external functions in C89, \lstinline!RealType! maps to \lstinline[language=C]!double!. In the mapping proposed in Annex~F of the C99 standard,
\lstinline!RealType!/\lstinline[language=C]!double! matches the IEC~60559:1989 (ANSI/IEEE~754-1985) \lstinline[language=C]!double! format.
\end{nonnormative}

\subsection{Integer Type}\doublelabel{integer-type}
The following is the predefined \lstinline!Integer! type:
\begin{lstlisting}[language=modelica]
Expand All @@ -1492,6 +1497,8 @@ \subsection{Integer Type}\doublelabel{integer-type}
end Integer;
\end{lstlisting}

The minimal recommended number range for \lstinline!IntegerType! is from -2147483648 to +2147483647, corresponding to a two's-complement 32-bit integer implementation.

\subsection{Boolean Type}\doublelabel{boolean-type}
The following is the predefined \lstinline!Boolean! type:
\begin{lstlisting}[language=modelica]
Expand Down Expand Up @@ -1725,12 +1732,6 @@ \subsection{Attributes start, fixed, nominal, and unbounded}\doublelabel{attribu
value can be propagated to the other variable).
\end{nonnormative}

\begin{nonnormative}
For external functions in C89, \lstinline!RealType! by default maps to \lstinline!double! and \lstinline!IntegerType! by default maps to
\lstinline!int!. In the mapping proposed in Annex~F of the C99 standard, \lstinline!RealType/double! matches the IEC 60559:1989 (ANSI/IEEE 754-1985)
\lstinline!double! format. Typically \lstinline!IntegerType! represents a 32-bit 2-complement signed integer.
\end{nonnormative}


\subsection{Other Predefined Types}\doublelabel{other-predefined-types}

Expand Down
6 changes: 2 additions & 4 deletions chapters/lexicalstructure.tex
Expand Up @@ -158,10 +158,8 @@ \subsection{Floating Point Numbers}\doublelabel{floating-point-numbers}

\subsection{Integer Literals}\doublelabel{integer-literals}

Literals of type \lstinline!Integer! are sequences of decimal digits, e.g. as in the
integer numbers \lstinline!33!, \lstinline!0!, \lstinline!100!, \lstinline!30030044!. The minimal
recommended number range is from -2147483648 to +2147483647 corresponding to a
two's-complement 32-bit integer implementation.
Literals of type \lstinline!Integer! are sequences of decimal digits, e.g.\ as in the integer numbers \lstinline!33!, \lstinline!0!, \lstinline!100!, \lstinline!30030044!.
The range of supported \lstinline!Integer! literals shall be at least large enough to represent the largest positive \lstinline!IntegerType! value, see \autoref{integer-type}.

\begin{nonnormative}
Negative numbers are formed by unary minus followed by an integer literal.
Expand Down

0 comments on commit 2f9219d

Please sign in to comment.