Mailinglist Archive: opensuse (3337 mails)

< Previous Next >
[Fwd: Re: [SLE] Real Numbers representation in Tcl language]
  • From: "John E. Perry" <j.e.perry@xxxxxxx>
  • Date: Wed, 12 Apr 2006 15:30:13 -0400
  • Message-id: <443D5545.1020802@xxxxxxx>
Sorry Greg, I forgot the SLE reply-to quirk.

--- Begin Message ---
  • From: "John E. Perry" <j.e.perry@xxxxxxx>
  • Date: Wed, 12 Apr 2006 09:59:10 -0400
  • Message-id: <443D07AE.3010200@xxxxxxx>
Greg Wallace wrote:

On Tuesday, April 11, 2006 @ 8:04 PM, Maura E. Monville wrote:


Is it possible that on a 32-bit machine the maximum value for a Real
number in Tcl language is 10^10 ?

Tcl's default math package uses the machine's C math libraries to do computation. You can also load any of several other math packages, some of which can do arbitrary precision. Whatever package you use will determine the limitation on your computational abilities.
But it's pretty safe to say that the maximum ordinate is
indeed dependent on machine architecture.
No, it's not. This has never been true. The machine may provide a hardware math unit, but this is not a fundamental limitation. As I said above, you can do arbitrary precision math on any machine that has such software written for it. Some 8-bit microprocessors had full IEEE floating point available, and some even had arbitrary precision math packages.
I mean, if you have 64 bits
available instead of 32, you can store both more precision and more order of
magnitude than on a 32 bit machine.
64 bits in the machine's data path affects only the speed of your processing -- not its ultimate abilities. With 64 bits, you can do stuff faster -- that's all. If your software is written to make use of it.
Now, whether the particular language
you are coding in is aware of the fact that it has those extra bits to work
with is a totally different matter.

Tcl had 64-bit precision, and even arbitrary precision available before there were 64-bit machines. Just as did C, FORTRAN, ...

By the way, Tcl stores variable values as strings. Some interim values are stored in binary during multi-step processing, and they are in the format of the math package in use. Storing values as strings means that whatever math packages you use, you don't necessarily have to drop bits when you convert from one math package's format to another's.
Note that I'm not a Tcl expert, just a user. Maura, you can get much better answers on comp.lang.tcl. You really should subscribe and take advantage of the real expertise there.
John Perry



--- End Message ---
< Previous Next >