Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I use the bignum package in a Windows environment?

30 views
Skip to first unread message

bwil...@gmail.com

unread,
Apr 24, 2008, 1:24:10 PM4/24/08
to
I'm using ActiveState ActiveTcl 8.5.0.0 and would like to use this
bignum package. When I try 'package require math::bignum' I get
"can't find package math::bignum." Any help would definitely be
appreciated. I've provided a link below for more info on this
package.

http://aspn.activestate.com/ASPN/docs/ActiveTcl/8.5/tcllib/math/bignum.html

Aric Bills

unread,
Apr 24, 2008, 1:41:19 PM4/24/08
to
Do you have tcllib installed? If not, there are a few ways to get it:

* 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

bwil...@gmail.com

unread,
Apr 24, 2008, 2:04:40 PM4/24/08
to
On Apr 24, 10:41 am, Aric Bills <aric.bi...@gmail.com> wrote:
> Do you have tcllib installed? If not, there are a few ways to get it:
>
> * 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 tohttp://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! =)

Jeff Hobbs

unread,
Apr 24, 2008, 2:47:20 PM4/24/08
to
On Apr 24, 10:24 am, "bwilso...@gmail.com" <bwilso...@gmail.com>
wrote:
> http://aspn.activestate.com/ASPN/docs/ActiveTcl/8.5/tcllib/math/bignu...

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

bwil...@gmail.com

unread,
Apr 24, 2008, 3:14:12 PM4/24/08
to

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.

Christian Nassau

unread,
Apr 24, 2008, 4:12:08 PM4/24/08
to
bwil...@gmail.com wrote:
> 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


Donald G Porter

unread,
Apr 24, 2008, 4:26:04 PM4/24/08
to
Christian Nassau wrote:
> I would have guessed that "format %x" should do the job, but apparently
> it's currently limited to 64 bits...

% format %llx 1234567890123456789012345
1056e0f36a6443de2df79

--
| Don Porter Mathematical and Computational Sciences Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

Aric Bills

unread,
Apr 24, 2008, 6:51:46 PM4/24/08
to
On Apr 24, 10:04 am, "bwilso...@gmail.com" <bwilso...@gmail.com>
wrote:

> 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.

Donald G Porter

unread,
Apr 28, 2008, 9:07:07 AM4/28/08
to
Aric Bills wrote:
> 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.

Aric Bills

unread,
Apr 28, 2008, 3:20:44 PM4/28/08
to
On Apr 28, 5:07 am, Donald G Porter <d...@nist.gov> wrote:
> Aric Bills wrote:
> > 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.
>
> --
> | Don Porter Mathematical and Computational Sciences Division |
> | donald.por...@nist.gov Information Technology Laboratory |
> |http://math.nist.gov/~DPorter/ NIST |
> |______________________________________________________________________|

Right you are. My bad.

Aric

0 new messages