|
From: Mo D. <md...@cy...> - 2000-07-22 18:51:19
|
On Sat, 22 Jul 2000, Don Bowman wrote:
> FYI I am looking at improving the 64-bit support in TCL.
> Specifically I am looking at making 64-bit integers work
> regardless of whether the machine is 32 or 64 bit.
> (ie using __int64 / long long).
>
> I need some opinions.
>
> The simplest way to do that is simply to raise the size
> of the value in a Tcl_Obj.
That might seem like a logical thing to do, but I
don't think it is a good idea. You are going to
run into portability issues. Besides, using 64
bit numbers means every math operation would be
done as a 64 bit operation, that could slow down
every integer operation in Tcl.
> Another way to do this is to define a set of new API,
> and deprecate the old ones, but keep them at the current
> size (32-bits in most cases).
> Tcl_NewIntObj
> Tcl_NewLongObj
...
> This is quite a bit more work, and extensions and so on
> need to be reworked if they wish to get access to larger precision
> types.
Yes but at least extensions would have a choice. There
could also be an expr func long() to go with the int() one.
I have run into this same problem in Jacl and Tcl Blend.
Java supports a 64 bit long type, but there is no way
to store it as a TclInteger object. I had to just
punt and pass 64 bit ints around as strings. It would
be better if there was a TclLong type in addition to
a TclInteger. I don't want to have to recompile Tcl
and all my extensions to make use of it.
Mo DeJong
Red Hat Inc
--
The TclCore mailing list is sponsored by Ajuba Solutions
To unsubscribe: email tcl...@aj... with the
word UNSUBSCRIBE as the subject.
|