Skip to content
Tcl Source Code View Ticket
Login

View Ticket

64-bit: [incr] and [expr +] disagree

Closed / Fixed520690ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-02-20 22:29:30
On Linux/Alpha, in tclsh8.4a4:

% set var [expr 1<<30]
1073741824
% set value [expr 1<<30]
1073741824
% expr {$var + $value}
2147483648
% incr var $value
-2147483648 

% proc test {} {
    set var [expr 1<<30]
    set value [expr 1<<30]
    puts [expr {$var + $value}]
    incr var $value
    puts $var
}
% test
2147483648
-2147483648
dgpplain2002-02-21 06:03:39
Logged In: YES 
user_id=80530

This is apparently due to the changes
to tcl.h that were committed on
2002-02-19.

On Alpha, TCL_WIDE_INT_IS_LONG apparently
needs to be defined to get this right.
dgp Closed ticket [520690ffff]. [History diff]2002-02-22 00:29:22
dgpplain2002-02-22 00:29:23
Logged In: YES 
user_id=80530

OK this is fixed now.
Log in (anonymous is fine) to add a comment.