diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-19 10:32:39 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-19 10:32:39 (GMT) |
commit | 92fa8abace9caa8f51c2ed50dab29494648f1b71 (patch) | |
tree | 5e90c99c08a69c6b4b862eaa3b455014b4183147 /doc | |
parent | 044a1745e42becc6ab1c89866e7e94fb89f8e714 (diff) | |
parent | 9e88eb9b4842b571659061b7785fe565a70024b7 (diff) | |
download | tcl-92fa8abace9caa8f51c2ed50dab29494648f1b71.zip tcl-92fa8abace9caa8f51c2ed50dab29494648f1b71.tar.gz tcl-92fa8abace9caa8f51c2ed50dab29494648f1b71.tar.bz2 |
TIP #697: 32-bit truncation in format and scan (let's gain some time)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/format.n | 3 | ||||
-rw-r--r-- | doc/scan.n | 25 |
2 files changed, 13 insertions, 15 deletions
diff --git a/doc/format.n b/doc/format.n index 59774fc..b1e204a 100644 --- a/doc/format.n +++ b/doc/format.n @@ -141,8 +141,7 @@ element of the \fBtcl_platform\fR array. If it is \fBL\fR it specifies that an integer or double value is taken without truncation for conversion to a formatted substring. If neither of those are present, the integer value is -truncated to the range determined by the value of the -\fBwordSize\fR element of the \fBtcl_platform\fR array). +truncated to a 32-bit range. .SS "MANDATORY CONVERSION TYPE" .PP The last thing in a conversion specifier is an alphabetic character @@ -73,17 +73,18 @@ The size modifier field is used only when scanning a substring into one of Tcl's integer values. The size modifier field dictates the integer range acceptable to be stored in a variable, or, for the inline case, in a position in the result list. -The syntactically valid values for the size modifier are \fBh\fR, \fBL\fR, -\fBl\fR, \fBz\fR, \fBt\fR, and \fBll\fR. The \fBh\fR size -modifier value is equivalent -to the absence of a size modifier in the the conversion specifier. -Either one indicates the integer range to be stored is limited to the range -determined by the value of the \fBwordSize\fR element of the \fBtcl_platform\fR -array). The \fBL\fR, \fBq\fR or \fBj\fR size modifiers are equivalent to the -\fBl\fR size modifier. Either of them indicates the integer range to be stored is -limited to the same range produced by the \fBwide()\fR function of -the \fBexpr\fR command. The \fBll\fR size modifier indicates that -the integer range to be stored is unlimited. +The syntactically valid values for the size modifier are \fBh\fR, +\fBl\fR, \fBz\fR, \fBt\fR, \fBq\fR, \fBj\fR, \fBll\fR, and \fBL\fR. +The \fBh\fR size modifier value is equivalent to the absence of a size +modifier in the the conversion specifier. Either one indicates the +integer range to be stored is limited to the 32-bit range. The \fBL\fR +size modifier is equivalent to the \fBll\fR size modifier. Either one +indicates the integer range to be stored is unlimited. The \fBl\fR (or +\fBq\fR or \fBj\fR) size modifier indicates that the integer range to be +stored is limited to the same range produced by the \fBwide()\fR function +of the \fBexpr\fR command. The \fBz\fR and \fBt\fR modifiers indicate the +integer range to be the same as for either \fBh\fR or \fBl\fR, depending +on the value of the \fBpointerSize\fR element of the \fBtcl_platform\fR array. .SS "MANDATORY CONVERSION CHARACTER" .PP The following conversion characters are supported: @@ -248,8 +249,6 @@ An interactive session demonstrating the truncation of integer values determined by size modifiers: .PP .CS -\fI%\fR set tcl_platform(wordSize) -4 \fI%\fR scan 20000000000000000000 %d 2147483647 \fI%\fR scan 20000000000000000000 %ld |