work on manual
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 6 May 2025 15:40:54 +0000 (08:40 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 6 May 2025 15:40:54 +0000 (08:40 -0700)
rust/doc/src/SUMMARY.md
rust/doc/src/language/expressions/functions/index.md [new file with mode: 0644]
rust/doc/src/language/expressions/functions/mathematical.md [new file with mode: 0644]
rust/doc/src/language/expressions/logical.md [new file with mode: 0644]
rust/doc/src/language/expressions/relational.md [new file with mode: 0644]

index a4071ce82d0763ced786f83ccd45533cc213c684..52ea354126b6f646beb1c301c0b1804114c2c3b0 100644 (file)
   - [Missing Values in Expressions](language/expressions/missing-values.md)
   - [Grouping Operators](language/expressions/grouping.md)
   - [Arithmetic Operators](language/expressions/arithmetic.md)
+  - [Logical Operators](language/expressions/logical.md)
+  - [Relational Operators](language/expressions/relational.md)
+  - [Functions](language/expressions/functions/index.md)
+    - [Mathemtical Functions](language/expressions/functions/mathematical.md)
 
 # Developer Documentation
 
diff --git a/rust/doc/src/language/expressions/functions/index.md b/rust/doc/src/language/expressions/functions/index.md
new file mode 100644 (file)
index 0000000..174d9a4
--- /dev/null
@@ -0,0 +1,11 @@
+# Functions
+
+PSPP functions provide mathematical abilities above and beyond those
+possible using simple operators.  Functions have a common syntax: each
+is composed of a function name followed by a left parenthesis, one or
+more arguments, and a right parenthesis.
+
+   Function names are not reserved.  Their names are specially treated
+only when followed by a left parenthesis, so that `EXP(10)` refers to
+the constant value e raised to the 10th power, but `EXP` by itself
+refers to the value of a variable called `EXP`.
diff --git a/rust/doc/src/language/expressions/functions/mathematical.md b/rust/doc/src/language/expressions/functions/mathematical.md
new file mode 100644 (file)
index 0000000..596d852
--- /dev/null
@@ -0,0 +1,24 @@
+# Mathematical Functions
+
+Advanced mathematical functions take numeric arguments and produce
+numeric results.
+
+* `EXP(EXPONENT)`  
+  Returns e (approximately 2.71828) raised to power `EXPONENT`.
+
+* `LG10(X)`  
+  Takes the base-10 logarithm of `X`.  If `X` is not positive, the
+  result is system-missing.
+
+* `LN(X)`  
+  Takes the base-e logarithm of `X`.  If `X` is not positive, the
+  result is system-missing.
+
+* `LNGAMMA(X)`  
+  Yields the base-e logarithm of the complete gamma of `X`.  If `X` is
+  a negative integer, the result is system-missing.
+
+* `SQRT(X)`  
+  Takes the square root of `X`.  If `X` is negative, the result is
+  system-missing.
+
diff --git a/rust/doc/src/language/expressions/logical.md b/rust/doc/src/language/expressions/logical.md
new file mode 100644 (file)
index 0000000..9d6e9b9
--- /dev/null
@@ -0,0 +1,24 @@
+# Logical Operators
+
+The logical operators take logical operands and produce logical results,
+meaning "true or false."  Logical operators are not true Boolean
+operators because they may also result in a system-missing value.  *Note
+Boolean Values::, for more information.
+
+* `A AND B`  
+  `A & B`  
+  True if both `A` and `B` are true, false otherwise.  If one operand
+  is false, the result is false even if the other is missing.  If both
+  operands are missing, the result is missing.
+
+* `A OR B`  
+  `A | B`  
+  True if at least one of `A` and `B` is true.  If one operand is
+  true, the result is true even if the other operand is missing.  If
+  both operands are missing, the result is missing.
+
+* `NOT A`  
+  `~A`  
+  True if `A` is false.  If the operand is missing, then the result is
+  missing.
+
diff --git a/rust/doc/src/language/expressions/relational.md b/rust/doc/src/language/expressions/relational.md
new file mode 100644 (file)
index 0000000..87614cb
--- /dev/null
@@ -0,0 +1,38 @@
+# Relational Operators
+
+The relational operators take numeric or string operands and produce
+Boolean results.
+
+   Strings cannot be compared to numbers.  When strings of different
+lengths are compared, the shorter string is right-padded with spaces to
+match the length of the longer string.
+
+   The results of string comparisons, other than tests for equality or
+inequality, depend on the character set in use.  String comparisons are
+case-sensitive.
+
+* `A EQ B`  
+  `A = B`  
+  True if `A` is equal to `B`.
+
+* `A LE B`  
+  `A <= B`  
+  True if `A` is less than or equal to `B`.
+
+* `A LT B`  
+  `A < B`  
+  True if `A` is less than `B`.
+
+* `A GE B`  
+  `A >= B`  
+  True if `A` is greater than or equal to `B`.
+
+* `A GT B`  
+  `A > B`  
+  True if `A` is greater than `B`.
+
+* `A NE B`  
+  `A ~= B`  
+  `A <> B`  
+  True if `A` is not equal to `B`.
+