Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-02-16
04:18 • Closed ticket [219224ffff]: expr and format comands should handle long long (int... artifact: 2d6c97b51c user: dkf
2002-01-17
01:42 • Ticket [219224ffff]: 5 changes artifact: 0c87911f0a user: hobbs
2001-08-25
01:24 • Ticket [219224ffff]: 1 change artifact: 0ccb9e7fe0 user: andreas_kupries
2001-08-02
08:45 • Ticket [219224ffff]: 2 changes artifact: 06aa53d793 user: hobbs
2001-06-06
22:22 • Ticket [219224ffff]: 4 changes artifact: 38c29d6912 user: dkf
2000-11-23
15:25 • Ticket [219224ffff]: 4 changes artifact: 983f15ba27 user: andreas_kupries
2000-11-22
17:00 • Ticket [219224ffff]: 4 changes artifact: da21643475 user: dkf
01:34 • Ticket [219224ffff]: 5 changes artifact: e00e4ff3ab user: hobbs
2000-11-21
20:41 • Ticket [219224ffff]: 4 changes artifact: 69e0b11a92 user: dkf
2000-10-26
05:03 • New ticket [219224ffff]. artifact: 3ea66799c4 user: nobody

expr and format comands should handle long long (int64)

Closed / Fixed219224ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2000-10-26 05:03:48
OriginalBugID: 4088 RFE
Version: 8.3b2
SubmitDate: '2000-01-26'
LastModified: '2000-03-30'
Severity: SER
Status: Assigned
Submitter: techsupp
ChangedBy: hobbs
OS: Solaris
OSVersion: Soalrsi 7 64 bit
Machine: Ultra Enterprise 4500
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


Name:
matthew Finch

DesiredBehavior:
Currently tclsh in its current form can only deal with numbers in the form of ints.

It would be good and help the project Im working on if expr and format commands could deal
with long longs' 

Currently I am looking at a the mpexpr pkg,but this doesnt take advantage of the byte code
compiler I believe



I don't know about long long's, but it would be nice to have
Tcl at least properly supports longs throughout expressions
and in the interpreter. 
-- 03/30/2000 hobbs
dkfplain2000-11-21 20:41:18
What is the support for 64-bit integer types like across different compilers?  I must admit that I don't follow this stuff very closely...
hobbsplain2000-11-22 01:34:28
ANSI C (keyword *ANSI*) has 64 bit integer types as int64_t and uint64_t, but they aren't supported by all ANSI compilers - just those that want to provide 64bit int support.  Windows has __int64.  Where int64_t isn't yet supported, you might try simulating it with long long.  An example that works on Windows, Linux (32-bit PIII) and Solaris (64-bit UltraSparc) is:
<PRE>
#ifdef _WIN32
#define int64_t  __int64
#define uint64_t unsigned __int64
#else
#include <sys/types.h>
#endif

#ifndef int64_t
#define int64_t long long
#define uint64_t unsigned long long
#endif

main()
{
    uint64_t i = 0;
    printf("sizeof int64 = %d\n", sizeof(int64_t));
}
</PRE>

You can improve on that by actually checking along the way until you get an 8-byte wide integer type instead of making the assumptions.
dkfplain2000-11-22 17:00:26
Wouldn't this be something for configure to discover for us?
andreas_kupriesplain2000-11-23 15:25:51
Only as long as there is no cross-compiling going on. And using linux to cross-compile for windows is quite tempting (I have already started doing this (began last Friday)).
dkfplain2001-06-06 22:22:43
Logged In: YES 
user_id=79902

Hmm. Surely even when cross-compiling you can test to see if
a thing will build? (That's the way configure works I
believe...) Then, if a compiler handles int64_t as a
meaningful type, or else __int64 or long long (in whatever
order you care to choose.)  The only problem comes when you
have a compiler which doesn't know any of those but defines
long to be 64-bit (I don't know if any such exist, of
course.)
hobbs Ticket [219224ffff]: 2 changes [History diff]2001-08-02 08:45:05
andreas_kupries Ticket [219224ffff]: 1 change [History diff]2001-08-25 01:24:29
hobbsplain2002-01-17 01:42:36
Logged In: YES 
user_id=72656

I believe this may fit in with dkf's 64-bit branch.
dkf Closed ticket [219224ffff]. [History diff]2002-02-16 04:18:10
Log in (anonymous is fine) to add a comment.