Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-06-10
07:31 • Closed ticket [53a4d9603c]: binary scan "f" example incorrect pl... artifact: 5ba3853971 user: oehhar
07:30
[53a4d960] doc binary scan f endianess correction in example check-in: 2d20784ad7 user: oehhar tags: core-9-0-branch
07:29
[53a4d960] doc binary scan f endianess correction in example check-in: 5c615eec61 user: oehhar tags: trunk, main
2026-06-09
14:00 • Ticket [53a4d9603c] binary scan "f" example incorrect status sti... artifact: e58ac84444 user: oehhar
2026-06-08
16:00 • Ticket [53a4d9603c]: 3 changes artifact: e2772a757a user: tomkiti
2026-06-03
20:18 • Ticket [53a4d9603c]: 3 changes artifact: 72f2bf1583 user: chw
17:54 • New ticket [53a4d9603c]. artifact: 2810506be8 user: tomkiti

[binary scan] "f" example incorrect

Closed / Fixed53a4d9603c3c670894e185fe441ed25ef22bdca3Created 182 days agoUpdated 176 days ago
Descriptionplain2026-06-03 17:54:00
The documentation for the [binary scan] command is incorrect for the "f" format character. The example shows:

    binary scan \x3F\xCC\xCC\xCD f var1

It should read:

    binary scan \xCD\xCC\xCC\x3F f var1
chwplain2026-06-03 20:18:54
Are you not on a Windows system running on an Intel Pentium processor
as the fine manual page mentions for this example?
tomkitiplain2026-06-08 16:00:09
I'm running on a Windows 11 PC (Intel) using Tcl 9.0.3 (64-bit). When I run the following command:

    binary scan \x3F\xCC\xCC\xCD f var1; puts $var1

I get:

    -429492192.0

When I run:

    binary scan \xCD\xCC\xCC\x3F f var1; puts $var1

I get:

    1.600000023841858

I get the same results on a Red Hat 10 PC.
oehharwiki2026-06-09 14:00:53

I have tried with 32bit 8.6.18 and 64 bit 9.0.3 and can confirm the observation by Tom. Platform is MS-Win 11 64 bit with MS-VC6 and MS-VS 2022.

Harald

oehharwiki2026-06-10 07:31:53

Done by commits:

Thanks, Harald

Log in (anonymous is fine) to add a comment.