- [Files Used by PSPP](language/files/index.md)
- [File Handles](language/files/file-handles.md)
- [Syntax Diagrams](language/syntax-diagrams.md)
+- [Expressions](language/expressions/index.md)
+ - [Boolean Values](language/expressions/boolean-values.md)
+ - [Missing Values in Expressions](language/expressions/missing-values.md)
+ - [Grouping Operators](language/expressions/grouping.md)
+ - [Arithmetic Operators](language/expressions/arithmetic.md)
# Developer Documentation
--- /dev/null
+# Arithmetic Operators
+
+The arithmetic operators take numeric operands and produce numeric
+results.
+
+* `A + B`
+ The sum of `A` and `B`.
+
+* `A - B`
+ The difference when `B` is subtracted from `A`.
+
+* `A * B`
+ The product of `A` and `B`. If either `A` or `B` is 0, then the result is
+ 0, even if the other operand is missing.
+
+* `A / B`
+ The quotient of `A` divided by `B`. If `A` is 0, then the result is 0,
+ even if `B` is missing. If `B` is zero, the result is system-missing.
+
+* `A ** B`
+ Yields the result of raising `A` to the power `B`. If `A` is
+ negative and `B` is not an integer, the result is system-missing.
+ `0**0` is also system-missing.
+
+* `- A`
+ Reverses the sign of `A`.
+
--- /dev/null
+# Boolean Values
+
+Some PSPP operators and expressions work with Boolean values, which
+represent true/false conditions. Booleans have only three possible
+values: 0 (false), 1 (true), and system-missing (unknown).
+System-missing is neither true nor false and indicates that the true
+value is unknown.
+
+ Boolean-typed operands or function arguments must take on one of
+these three values. Other values are considered false, but provoke a
+warning when the expression is evaluated.
+
+ Strings and Booleans are not compatible, and neither may be used in
+place of the other.
--- /dev/null
+# Grouping Operators
+
+Parentheses (`()`) are the grouping operators. Surround an expression
+with parentheses to force early evaluation.
+
+ Parentheses also surround the arguments to functions, but in that
+situation they act as punctuators, not as operators.
+
--- /dev/null
+# Mathematical Expressions
+
+Expressions share a common syntax each place they appear in PSPP
+commands. Expressions are made up of "operands", which can be numbers,
+strings, or variable names, separated by "operators". There are five
+types of operators: grouping, arithmetic, logical, relational, and
+functions.
+
+ Every operator takes one or more operands as input and yields exactly
+one result as output. Depending on the operator, operands accept
+strings or numbers as operands. With few exceptions, operands may be
+full-fledged expressions in themselves.
--- /dev/null
+# Missing Values in Expressions
+
+Most numeric operators yield system-missing when given any
+system-missing operand. A string operator given any system-missing
+operand typically results in the empty string. Exceptions are listed
+under particular operator descriptions.
+
+ String user-missing values are not treated specially in expressions.
+
+ User-missing values for numeric variables are always transformed into
+the system-missing value, except inside the arguments to the `VALUE` and
+`SYSMIS` functions.
+
+ The missing-value functions can be used to precisely control how
+missing values are treated in expressions. *Note Missing Value
+Functions::, for more details.
+