[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
Log in (anonymous is fine) to add a comment.