http://aspn.activestate.com/ASPN/docs/ActiveTcl/8.5/tcllib/math/bignum.html
* you could install ActiveTcl 8.4 alongside 8.5. I would uninstall
8.5, install 8.4, then reinstall 8.5. It's not as complicated as it
sounds; the process shouldn't take more than a few minutes.
* you could use teapot/teacup to fetch it for you: http://wiki.tcl.tk/7579
. I've never used it so I can't help you any more there.
* you could just go to http://tcllib.sourceforge.net/ and download
it. If you go this route, you have to put it into a directory in your
$auto_path, or else append the directory where you put it to your
$auto_path.
Hope that helps,
Aric
I'm not sure if I have tcllib installed. I went ahead and uninstalled
ActiveTcl 8.5 and downloaded the Windows packages for 8.4.18 and
8.5.2. When installing the two versions, should I install them both
to the same directory or different directories? I'm guessing they
should be installed to different ones but just wanted to make sure.
Thanks for the help! =)
Aside from the tcllib install issue, are you really sure you want that
package in conjunction with 8.5? That package was written for
8.3/8.4, prior to Tcl's core inclusion of bignum support. I believe
that you should be able to just rely on the core exprs now for what
you need.
Regards,
Jeff
I just want the best performance method of manipulating arbitrary
precision numbers. Like converting between base 2, 10, and 16, etc.
I know they added 64-bit support to TCL 8.5 but do you know if there
are ways of handling arbitrary length numbers? I've used mpexpr
before as well.
As Jeff Hobbs already pointed out, Tcl 8.5 does support arbitrary length
integers natively, and you can also easily convert to base 10 from base
2 and 16 with expr:
% expr 893462639654384386598348 * 98162786243732476432864232378
87704782113154310266601813151301296276690297622911544
% expr 0x183621786317836127879235634897432794237497273249
593662982854666795903284635341811402338104224387248370249
% expr 0b1010101011111111111101111
22413295
% info patchlevel
8.5.2
I don't know a quick way to go from base 10 to either 2 or 16, though. I
would have guessed that "format %x" should do the job, but apparently
it's currently limited to 64 bits...
HTH,
--
=> Christian Nassau, http://www.nullhomotopie.de
% format %llx 1234567890123456789012345
1056e0f36a6443de2df79
--
| Don Porter Mathematical and Computational Sciences Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
> I'm not sure if I have tcllib installed. I went ahead and uninstalled
> ActiveTcl 8.5 and downloaded the Windows packages for 8.4.18 and
> 8.5.2. When installing the two versions, should I install them both
> to the same directory or different directories? I'm guessing they
> should be installed to different ones but just wanted to make sure.
> Thanks for the help! =)
It looks like people smarter than me have addressed the core issue,
but to answer your question, they should be installed to the same
directory. ActiveTcl 8.4 is a "batteries-included" distro, while 8.5
is designed to be "batteries-available-via-teacup"; if they are in the
same directory, they can share the batteries :) ActiveState has
designed the two distributions so that they can coexist in the same
directory.
Alternatively, if you have some compelling reason to put them in
different directories (for example, you already installed them that
way and can't be bothered to reinstall them) you can set or modify the
TCL_LIBRARY environment variable so that it includes the library
directory of the 8.4 install.
NO!
No, no, no, no, no no.
TCL_LIBRARY is all about where to find the "init.tcl" file during
Tcl_Init(). It has (nearly) nothing to do with the search for installed
packages. And it should not be set except as a very last resort by an
end user working around a broken install of a program he cannot fix.
TCLLIBPATH is what you want.
Right you are. My bad.
Aric