Skip to content

Commit 09bdd63

Browse files
authored
Give safe alternative for integer min. (#3702)
* Give safe alternative for integer min. * FromReview
1 parent 9ad2a92 commit 09bdd63

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

chapters/classes.tex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,11 @@ \subsection{Integer Type}\label{integer-type}
15601560
The default \lstinline!min!- and \lstinline!max!-attributes are the minimum and maximum numbers of \lstinline!IntegerType!.
15611561
The minimal recommended number range for \lstinline!IntegerType! is from -2147483648 to +2147483647, corresponding to a two's-complement 32-bit integer implementation.
15621562

1563+
\begin{nonnormative}
1564+
Note that \lstinline!-2147483648! as a Modelica expression is the negation of a number above the minimal recommended number range.
1565+
To express the lower limit with all intermediate results within the minimal recommended number range, one may write \lstinline!-2147483647 - 1! instead.
1566+
\end{nonnormative}
1567+
15631568
The fallback value is the closest value to $0$ consistent with the \lstinline!min! and \lstinline!max! bounds.
15641569

15651570
The default \lstinline!fixed!-attribute is \lstinline!true! for parameters and constants, and \lstinline!false! for other variables.

0 commit comments

Comments
 (0)