summaryrefslogtreecommitdiffstats
path: root/doc/binary.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/binary.n')
-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