Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2003-02-22
05:03 • Closed ticket [690774ffff]: binary scan fails with certain 64-bit ints plu... artifact: 85779354f1 user: dkf
00:27 • Ticket [690774ffff]: 1 change artifact: 80e8342fe0 user: kennykb
2003-02-21
17:26 • New ticket [690774ffff]. artifact: 9609e019c6 user: kennykb

[binary scan] fails with certain 64-bit ints

Closed / Fixed690774ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2003-02-21 17:26:41
If a 'w' format group on [binary scan] gets a 64-bit integer with the 2**31 bit set, it returns incorrect 
results.

% binary scan [binary format w [expr { wide(3) << 31 }]] w x
1
% set x
-2147483648

% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(machine)   = intel
tcl_platform(os)        = Windows NT
tcl_platform(osVersion) = 5.0
tcl_platform(platform)  = windows
tcl_platform(user)      = kennykb
tcl_platform(wordSize)  = 4
% set tcl_patchLevel
8.4.1
kennykb Ticket [690774ffff]: 1 change [History diff]2003-02-22 00:27:34
dkfplain2003-02-22 05:03:07
Logged In: YES 
user_id=79902

What was I thinking of when I wrote that code? :^(
Log in (anonymous is fine) to add a comment.