summaryrefslogtreecommitdiff
path: root/docs/manual.org
diff options
context:
space:
mode:
Diffstat (limited to 'docs/manual.org')
-rw-r--r--docs/manual.org8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/manual.org b/docs/manual.org
index 92160c3..bc58ceb 100644
--- a/docs/manual.org
+++ b/docs/manual.org
@@ -98,12 +98,12 @@ You can also use the special setting names ~custom_unit_file~, ~custom_dimension
* Appendices
** Unit Expressions
A unit expression is simply a math expression where the values being operated on are units or numbers. The operations that can be used are (in order of precedence):
-- Exponentiation (^); the exponent must be an integer. Both units and numbers can be raised to an exponent
-- Multiplication (*) and division (/). Multiplication can also be done with a space (so "15 meter" is the same thing as "15 * meter").
+- Exponentiation (^); the exponent must be an integer. Both units and numbers can be raised to an exponent.
+- Multiplication (*) and division (/). Multiplication can also be done with a space (so "15 meter" is the same thing as "15 * meter"), and multiplication using spaces has higher precedence than division. Therefore, "2 m / 1 m" is the number 2, while "2 * m / 1 * m" is equal to 2 m^2.
You can also divide with ~|~ to create fractions. Using ~|~ instead of ~/~ gives the division a higher precedence than any other operator. For example, "2|5^2" evaluates to 4/25, not 2/25.
-- Addition (+) and subtraction (-). They can only be done between units of the same dimension (measuring the same thing). So you can add metres, inches and feet together, and you can add joules and calories together, but you can't add metres to seconds, or feet to calories, or watts to pounds.
+- Addition (+) and subtraction (-). They can only be done between units of the same dimension (measuring the same thing). So you can add metres, inches and feet together, and you can add joules and calories together, but you can't add metres to seconds, or feet to calories, or watts to pounds. *You must use spaces between terms when adding or subtracting - "1 + 2" is valid, "1+2" is not. This only applies to addition and subtraction - other operators do not need spaces between them.* This is done to avoid complex rules when working with negative numbers and e-notation.
- Brackets can be used to manipulate the order of operations, and nonlinear units like Celsius and Fahrenheit cannot be used in expressions. You can use a value in a nonlinear unit by putting brackets after it - for example, degC(12) represents the value 12 \deg C
+ Brackets can be used to manipulate the order of operations, and nonlinear units like Celsius and Fahrenheit cannot be used in expressions. You can use a value in a nonlinear unit by putting brackets after it - for example, degC(12) represents the value 12 \deg{}C
** Other Expressions
There are also a simplified version of expressions for prefixes and dimensions. Only multiplication, division and exponentation are supported. Currently, exponentation is not supported for dimensions, but that may be fixed in the future.
* Footnotes