Skip to content

Commit

Permalink
Support non-integer exponents to handle the result of square.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Nov 16, 2023
1 parent 8d587bf commit b42bdcf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chapters/unitexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ \section{The Syntax of Unit Expressions}\label{the-syntax-of-unit-expressions}

unit-exponent :
[ "+" | "-" ] UNSIGNED-INTEGER
| "^" "(" [ "+" | "-" ] UNSIGNED-INTEGER "/" UNSIGNED-INTEGER ")"
\end{lstlisting}

The SI standard uses super-script for the exponentation, and does thus not define any operator symbol for exponentiation.
A \lstinline[language=grammar]!unit-factor! consists of a \lstinline[language=grammar]!unit-operand! possibly suffixed by a possibly signed integer number, which is interpreted as an exponent.
A \lstinline[language=grammar]!unit-factor! normally consists of a \lstinline[language=grammar]!unit-operand! possibly suffixed by a possibly signed integer number, which is interpreted as an exponent.
Non-integer exponents are needed to fully support the unit for square roots (and can be used for roots in general).
They are intended to be only be used when needed, and thus the fraction must be simplified and the denominator may not be one (or zero).
They use an explicit exponentation operator to be easy to recognize.
There must be no spacing between the \lstinline[language=grammar]!unit-operand! and a possible \lstinline[language=grammar]!unit-exponent!.

\begin{lstlisting}[language=grammar]
Expand Down

0 comments on commit b42bdcf

Please sign in to comment.