|
From: Maurice L. <mj...@ga...> - 2002-10-16 03:03:21
|
Joao Cardoso writes:
> On Tuesday 15 October 2002 23:07, Maurice LeBrun wrote:
> > | The story becomes more interesting. I believe the two representations
> > | (variable or tclMatrix) would've given the same result in pre-Tcl8.0.
> > | The reason being that in the old Tcl, "everything's a string". But no
> > | longer -- the variable that you create with "set" is "dual-ported",
> > | meaning it has both a binary and string representation. The binary one
> > | is used in expression evaluations and so is more accurate.
>
> But this means that it is single precision, doesn't it? Tcl is build with
> floats or doubles? So, if the default is float, as I supose, we shouldn't
> compare plots made with the tcl front-ends with plots made from frontends
> compiled with doubles. It is not the device driver that matters, but the
> origin of the data -- floats in, say, x08.tcl with doubles in x08c. And I
> think to remember from Alan's e-mail (that I dont have at the moment) that he
> was using plplot compiled with doubles.
Tcl uses double internally. But the precision when printing them out defaults
to 12. From the tclvars man page:
tcl_precision
This variable controls the number of digits to generate when |
converting floating-point values to strings. It defaults to |
12. 17 digits is ``perfect'' for IEEE floating-point in that |
it allows double-precision values to be converted to strings |
and back to binary with no loss of information. However, |
using 17 digits prevents any rounding, which produces longer, |
less intuitive results. For example, expr 1.4 returns |
1.3999999999999999 with tcl_precision set to 17, vs. 1.4 if |
tcl_precision is 12. |
--
Maurice LeBrun mj...@ga...
Research Organization for Information Science and Technology of Japan (RIST)
|