diff --git a/chapters/lexicalstructure.tex b/chapters/lexicalstructure.tex index d265538e8..9571cf510 100644 --- a/chapters/lexicalstructure.tex +++ b/chapters/lexicalstructure.tex @@ -260,7 +260,6 @@ \subsection{Units of Literal Constants}\label{units-literal-constants} \begin{nonnormative} Rationale: by default, literal Real and Integer constants do not have a defined, non-empty \lstinline!unit! string attribute; hence they act as "unit wildcards", preventing to perform dimensional consistency checking of equations that contain them. The rules regarding multiplication and division prevent this effect, allowing, e.g., to determine that `v = sqrt(2*g*h)` is dimensionally consistent, while `v = sqrt(2*g)` is dimensionally inconsistent, and thus most likely wrong. The rules regarding addition and subtraction instead allow to perform some basic unit inference in expressions containing mixed literal constants and variables (when there are no ambiguities in doing so), again expanding the scope for dimensional consistency checking. For example, they allow to determine that `tau = L/(abs(v) + 1e-9)` is dimensionally consistent, while `tau = 1/(abs(v) + 1e-9)` is not.]_ -Non-dimensional literal factors, e.g., \lstinline!2! in \lstinline!v = sqrt(2*g*h)! in physical laws involving quantities with units are always meant to be dimensionless, so they should be considered as such by giving them \lstinline!unit = "1"!. This allows to find out that, e.g., \lstinline!v = sqrt(2*h)! is dimensionally inconsistent (hence most likely wrong), because it has unit \lstinline!"m/s"! on the left-hand side and unit \lstinline!"m0.5"! on the right-hand side, which are not consistent. Without this rule, \lstinline!2! would have the default \lstinline!unit = ""! of \lstinline!Real!, making it impossible to determine the right-hand side unit.