Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL Number error?

Status
Not open for further replies.

homerjj

Programmer
Aug 6, 2007
3
GB
WHy when i run the following command do i get the following error.
"
tcl> expr 20000000000
Error: integer value too large to represent"

But when i use a larger number it works fine.
 
I don't run into your problem:
Code:
% expr 20000000000
20000000000
% expr 20000000000*4
80000000000
%
I'm using Tcl 8.4.5 on Windows 2000.

_________________
Bob Rashkin
 
Thanks
for the reply but i didnt explain it very well.

Here is another example of the inconsistencey

tcl> expr 2147483648
-2147483648

Surely this is wrong and occurs for numbers between 2^31 and 2^-32.

Any ideas as to why this occurs?
 
Here's another:-

tcl>expr 4294967290
-6

Why?
 
still:
Code:
% expr 2147483648
2147483648
% expr 4294967290
4294967290
%

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top