Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-10-27
05:43 • Closed ticket [1820988fff]: "string is integer" incorrect for large in... artifact: 37c8104303 user: msofer
2007-10-26
22:33 • New ticket [1820988fff]. artifact: bc277a2a36 user: nobody

"string is integer" incorrect for large integers

Closed / Invalid1820988fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-10-26 22:33:54
PLATFORM
Mac OS X 10.4.10 (Intel)

VERSION
Tcl 8.5b1 (via ActiveTcl 8.5.0.0 build 282058)

PROBLEM
"string is integer" doesn't recognize large integers as such.

EXPECTED BEHAVIOR
As I understand, Tcl 8.5 now supports arbitrary precision integers. "string is integer" should be able to correctly recognize large integers.

EXAMPLE
string is integer 1000
=> 1

string is integer 10000000000000000000000000000
=> 0

Thanks!
msoferplain2007-10-27 05:43:37
Logged In: YES 
user_id=148712
Originator: NO

% set x 1000000000000000000
1000000000000000000
% string is integer $x
0
% string is wideinteger $x
1

See the man page: [string is integer] checks for 32-bit integers:
http://www.tcl.tk/man/tcl8.5/TclCmd/string.htm#M26
Log in (anonymous is fine) to add a comment.