summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-02-10 10:28:02 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-02-10 10:28:02 (GMT)
commit7f0e970f874b93c796ce68d417bad79ee084af58 (patch)
treee2219e280ff7679d0817719122ee7d6275b002eb /doc
parent7bb6a4e1ba332784f0246857ead7a67bcac3c143 (diff)
downloadtcl-7f0e970f874b93c796ce68d417bad79ee084af58.zip
tcl-7f0e970f874b93c796ce68d417bad79ee084af58.tar.gz
tcl-7f0e970f874b93c796ce68d417bad79ee084af58.tar.bz2
More consistency. [Bug 1117017]
Diffstat (limited to 'doc')
-rw-r--r--doc/binary.n14
1 files changed, 9 insertions, 5 deletions
diff --git a/doc/binary.n b/doc/binary.n
index 582b562..d25e120 100644
--- a/doc/binary.n
+++ b/doc/binary.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: binary.n,v 1.11.2.7 2004/10/27 14:23:41 dkf Exp $
+'\" RCS: @(#) $Id: binary.n,v 1.11.2.8 2005/02/10 10:28:21 dkf Exp $
'\"
.so man.macros
.TH binary n 8.0 Tcl "Tcl Built-In Commands"
@@ -476,7 +476,7 @@ stored in \fBvar2\fR. Note that the integers returned are signed, but
they can be converted to unsigned 8-bit quantities using an expression
like:
.CS
-\fBexpr ( $num + 0x100 ) % 0x100\fR
+\fBexpr { $num & 0xff }\fR
.CE
.RE
.IP \fBs\fR 5
@@ -495,7 +495,7 @@ stored in \fBvar2\fR. Note that the integers returned are signed, but
they can be converted to unsigned 16-bit quantities using an expression
like:
.CS
-\fBexpr ( $num + 0x10000 ) % 0x10000\fR
+\fBexpr { $num & 0xffff }\fR
.CE
.RE
.IP \fBS\fR 5
@@ -521,8 +521,12 @@ example,
\fBbinary scan \\x05\\x00\\x00\\x00\\x07\\x00\\x00\\x00\\xf0\\xff\\xff\\xff i2i* var1 var2\fR
.CE
will return \fB2\fR with \fB5 7\fR stored in \fBvar1\fR and \fB-16\fR
-stored in \fBvar2\fR. Note that the integers returned are signed and
-cannot be represented by Tcl as unsigned values.
+stored in \fBvar2\fR. Note that the integers returned are signed, but
+they can be converted to unsigned 32-bit quantities using an expression
+like:
+.CS
+\fBexpr { $num & 0xffffffff }\fR
+.CE
.RE
.IP \fBI\fR 5
This form is the same as \fBI\fR except that the data is interpreted