summaryrefslogtreecommitdiffstats
path: root/doc/mathop.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-05-29 09:48:29 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-05-29 09:48:29 (GMT)
commit21a263ff25b234d76b4215f24087263e934110cf (patch)
treea19c305f82d180a47f31466d9bedd2e93df532dc /doc/mathop.n
parenta323b36b630d69fb11b797938d4d360e95fe0e8e (diff)
parent3be8c207009de29d1b986abc9e11c9815a42beec (diff)
downloadtcl-21a263ff25b234d76b4215f24087263e934110cf.zip
tcl-21a263ff25b234d76b4215f24087263e934110cf.tar.gz
tcl-21a263ff25b234d76b4215f24087263e934110cf.tar.bz2
[Bug 2931407]: Clarified semantics of division and remainder operators.
Diffstat (limited to 'doc/mathop.n')
-rw-r--r--doc/mathop.n15
1 files changed, 10 insertions, 5 deletions
diff --git a/doc/mathop.n b/doc/mathop.n
index e359276..ac2ebc1 100644
--- a/doc/mathop.n
+++ b/doc/mathop.n
@@ -126,14 +126,19 @@ will be an integer.
.TP
\fB%\fR \fInumber number\fR
.
-Returns the integral modulus of the first argument with respect to the second.
-Each \fInumber\fR must have an integral value. Note that Tcl defines this
-operation exactly even for negative numbers, so that the following equality
-holds true:
+Returns the integral modulus (i.e., remainder) of the first argument
+with respect to the second.
+Each \fInumber\fR must have an integral value.
+Also, the sign of the result will be the same as the sign of the second
+\fInumber\fR, which must not be zero.
.RS
.PP
+Note that Tcl defines this operation exactly even for negative numbers, so
+that the following command returns a true value (omitting the namespace for
+clarity):
+.PP
.CS
-(\fIx \fB/ \fIy\fR) \fB* \fIy \fB== \fIx \fB\-\fR (\fIx \fB% \fIy\fR)
+\fB==\fR [\fB*\fR [\fB/\fI x y\fR] \fIy\fR] [\fB\-\fI x\fR [\fB%\fI x y\fR]]
.CE
.RE
.TP