On 21/08/2022 19:31, Paul Obermeier wrote:
> When running the following simple script, I get different outputs
> depending on Tcl version and operating system.
> Can anyone confirm?
> Is it a bug or feature?
>
The differences you see seem mostly attributable to a 64-bit tclsh
(linux) vs 32-bit tclsh (windows). They are not related to binary
strings at all. In all cases the binary scan returns -539222988. But
printing a negative number in hex with 64-bits produces 16 characters,
while you only get 8 characters when using 32-bits.
The other difference between 8.6 and 8.7 on a 32-bit tclsh are due to
TIP 514. Before TIP 514, the int() function would cut the number to the
native integer size. With your 32-bit tclsh on windows, that produces a
negative number. On the 64-bit tclsh on linux, enough bits are available
to represent the full number. After TIP514, no truncation takes place at
all anymore.
Schelte.