Skip to content

Commit

Permalink
Merge pull request #3439 from HansOlsson/NonIntegerUnitExponent
Browse files Browse the repository at this point in the history
Support non-integer exponents to handle the result of square root
  • Loading branch information
HansOlsson authored Dec 7, 2023
2 parents ed76f68 + 121a8a9 commit d20ee7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chapters/unitexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ \section{The Syntax of Unit Expressions}\label{the-syntax-of-unit-expressions}
unit-operand [ unit-exponent ]

unit-exponent :
[ "+" | "-" ] UNSIGNED-INTEGER
[ "+" | "-" ] ( 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! consists of a \lstinline[language=grammar]!unit-operand! possibly suffixed by a possibly signed integer or rational number, which is interpreted as an exponent.
There must be no spacing between the \lstinline[language=grammar]!unit-operand! and a possible \lstinline[language=grammar]!unit-exponent!.
It is recommended to use the simplest representation of exponents, meaning that the explicit \lstinline!+! sign should be avoided, that leading zeros should be avoided, that rational exponents are reduced to not have common factors in the numerator and denominator, that rational exponents with denominator 1 should be avoided in favor of plain integer exponents, that the exponent 1 is omitted, and that entire factors with exponent 0 are omitted.

\begin{lstlisting}[language=grammar]
unit-operand :
Expand Down

0 comments on commit d20ee7b

Please sign in to comment.