aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/sciteco.7.template28
-rw-r--r--tests/testsuite.at11
2 files changed, 27 insertions, 12 deletions
diff --git a/doc/sciteco.7.template b/doc/sciteco.7.template
index b43b4d2..4736be2 100644
--- a/doc/sciteco.7.template
+++ b/doc/sciteco.7.template
@@ -2323,7 +2323,7 @@ in portable macros.
This is not the case, for instance when working with environment
registers.
.TP
-.SCITECO_TOPIC """S" """T"
+.SCITECO_TOPIC """S" """T" success true
.IB n \(dqS
.TQ
.IB n \(dqT
@@ -2332,7 +2332,7 @@ success (or truth).
Therefore it is equivalent to a check for less than
zero (negative).
.TP
-.SCITECO_TOPIC """F" """U"
+.SCITECO_TOPIC """F" """U" failure false
.IB n \(dqF
.TQ
.IB n \(dqU
@@ -2341,17 +2341,19 @@ failure (or falsehood).
Therefore it is equivalent to a check for greater than
or equal to zero (non-negative).
.TP
-.SCITECO_TOPIC """E" """="
+.SCITECO_TOPIC """E" """=" equal
.IB n \(dqE
.TQ
.IB n \(dq=
Applies if \fIn\fP equals zero.
.br
-To check two values \fIa\fP and \fIb\fP for equality you
-will commonly write:
-.IB a - b \(dq=
+The classic idiom for checking two values \fIa\fP and \fIb\fP for equality is
+.IB a - b \(dq=\c
+, but writing
+.IB a ^# b \(dq=
+(XOR operator) is faster.
.TP
-.SCITECO_TOPIC """G" """>"
+.SCITECO_TOPIC """G" """>" greater
.IB n \(dqG
.TQ
.IB n \(dq>
@@ -2361,7 +2363,7 @@ To check if a value \fIa\fP is greater than a value \fIb\fP you
will commonly write:
.IB a - b \(dq>
.TP
-.SCITECO_TOPIC """L" """<"
+.SCITECO_TOPIC """L" """<" lesser
.IB n \(dqL
.TQ
.IB n \(dq<
@@ -2371,13 +2373,15 @@ To check if a value \fIa\fP is less than a value \fIb\fP you
will commonly write:
.IB a - b \(dq<
.TP
-.SCITECO_TOPIC """N"
+.SCITECO_TOPIC """N" unequal
.IB n \(dqN
Applies if \fIn\fP is not zero.
.br
-To check two values \fIa\fP and \fIb\fP for inequality you
-will commonly write:
-.IB a - b \(dqN
+The classic idiom for checking two values \fIa\fP and \fIb\fP for inequality is
+.IB a - b \(dqN\c
+, but writing
+.IB a ^# b \(dqN
+(XOR operator) is faster.
.TP
.SCITECO_TOPIC """R"
.IB n \(dqR
diff --git a/tests/testsuite.at b/tests/testsuite.at
index d8d88e1..3a33838 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -126,6 +126,17 @@ AT_CHECK([$SCITECO -e "$MAXINT64\\ J::@S/$MAXINT64/\"F(0/0)'"], 0, ignore, ignor
AT_CHECK([$SCITECO -e "$MININT64\\ J::@S/$MININT64/\"F(0/0)'"], 0, ignore, ignore)
AT_CLEANUP
+# This should always work, at least on systems with a two's complement
+# representation of negative integers.
+# We will probably never meet anything else, but at least we check.
+AT_SETUP([Integer comparisons])
+AT_CHECK([$SCITECO -e "($MAXINT32)-($MAXINT32)\"N(0/0)'"], 0, ignore, ignore)
+AT_CHECK([$SCITECO -e "($MININT32)-($MININT32)\"N(0/0)'"], 0, ignore, ignore)
+AT_SKIP_IF([test $TECO_INTEGER -lt 64])
+AT_CHECK([$SCITECO -e "($MAXINT64)-($MAXINT64)\"N(0/0)'"], 0, ignore, ignore)
+AT_CHECK([$SCITECO -e "($MININT64)-($MININT64)\"N(0/0)'"], 0, ignore, ignore)
+AT_CLEANUP
+
AT_SETUP([Convert between line and glyph positions])
AT_CHECK([$SCITECO -e "@I/1^J2^J3/J 2^QC :^Q-3\"N(0/0)'"], 0, ignore, ignore)
AT_CLEANUP