Skip to content

Commit

Permalink
Update lexicalstructure.tex
Browse files Browse the repository at this point in the history
  • Loading branch information
casella committed Nov 10, 2022
1 parent b3e0dc1 commit 3370313
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapters/lexicalstructure.tex
Expand Up @@ -259,7 +259,7 @@ \subsection{Units of Literal Constants}\label{units-literal-constants}
In that case, their outputs are also implicitly assumed to have a dimensionless unit.

\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.]_
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 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.]_


The rules involving elementary mathematical functions extend the scope of this concept to also allow determining that equations such as \lstinline!i = i0*exp(v/i0)! or \lstinline!i = v0*exp(i/i0)! are dimensionally inconsistent.
Expand Down

0 comments on commit 3370313

Please sign in to comment.