Tcl 8.5 and special numbers



Hello,

with version 8.5 Tcl supports the special IEEE numbers: Not-a-number,
+ and - Infinity,
(perhaps + and - 0?). Fine so far, but I see in a library I use and
help maintain
(PLplot - http://plplot.sourceforge.net) that certain special numbers
(I think NaNs) are
formatted as "-1.#IND".

The problem is a bit convoluted as up to now the Tcl interface to
PLplot is based on the
string-interface (I intend to change that soon ;)): The special
numbers get printed on the C side
as "-1.#IND" (using printf()) and are passed on as such a string. I
see the same string via Tcl's
puts, but that is probably because they were not interpreted as
numbers inbetween.

I would like to know if Tcl 8.5 regards the underlying bit pattern as
NaN or as something
else entirely. Is this one of the nasty platform-dependencies that we
need to watch out
for? I am used to such representations of NaNs as "1.#QNAN" and
various others ...

(My platform: Windows XP, MSVC/C++ 6.0)

Regards,

Arjen
.



Relevant Pages

  • Re: Tcl 8.5 and special numbers
    ... (I think NaNs) ... The problem is a bit convoluted as up to now the Tcl interface to ... as "-1.#IND" ) and are passed on as such a string. ... format the number and then try to use that string in Tcl. ...
    (comp.lang.tcl)
  • Re: Tcl 8.5 and special numbers
    ... Tcl doesn't know how to interpret the strings, ... format the number and then try to use that string in Tcl. ... since the NaNs all error out early in most cases. ...
    (comp.lang.tcl)