From 347c806dd03b9b1335e0757cb0be38836dc4712b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 6 May 2025 08:40:54 -0700 Subject: [PATCH] work on manual --- rust/doc/src/SUMMARY.md | 4 ++ .../language/expressions/functions/index.md | 11 ++++++ .../expressions/functions/mathematical.md | 24 ++++++++++++ rust/doc/src/language/expressions/logical.md | 24 ++++++++++++ .../src/language/expressions/relational.md | 38 +++++++++++++++++++ 5 files changed, 101 insertions(+) create mode 100644 rust/doc/src/language/expressions/functions/index.md create mode 100644 rust/doc/src/language/expressions/functions/mathematical.md create mode 100644 rust/doc/src/language/expressions/logical.md create mode 100644 rust/doc/src/language/expressions/relational.md diff --git a/rust/doc/src/SUMMARY.md b/rust/doc/src/SUMMARY.md index a4071ce82d..52ea354126 100644 --- a/rust/doc/src/SUMMARY.md +++ b/rust/doc/src/SUMMARY.md @@ -30,6 +30,10 @@ - [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 index 0000000000..174d9a4fff --- /dev/null +++ b/rust/doc/src/language/expressions/functions/index.md @@ -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 index 0000000000..596d852b61 --- /dev/null +++ b/rust/doc/src/language/expressions/functions/mathematical.md @@ -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 index 0000000000..9d6e9b903a --- /dev/null +++ b/rust/doc/src/language/expressions/logical.md @@ -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 index 0000000000..87614cba47 --- /dev/null +++ b/rust/doc/src/language/expressions/relational.md @@ -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`. + -- 2.30.2