ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcl-core
tcl-core
Re: [TCLCORE] Re: TIP 132 and NaN
by Donald G Porter other posts by this author
Apr 20 2006 9:19AM messages near this date
[TCLCORE] Re: TIP 132 and NaN | [TCLCORE] Call For Papers: 13th Annual Tcl/Tk Conference, Oct. 9-13, 2006
>  During the early discussions of TIP 132, the issue was raised
>  that checking in [expr] does not suffice, because extensions
>  (including Tk) could also get unexpected NaN's if somehow
>  the string "NaN" or one of its variants were to reach
>  Tcl_GetDoubleFromObj (which prior to 8.5, rejected NaN's
>  entirely).  

The code of the Tcl_GetDoubleFromObj() routines does not
indicate that.  A "pure NaN" has clearly been able to pass
through Tcl unmolested.

When conversion to/from string rep is considered, then whether
or not NaN values could pass through Tcl dependend on
what the sprintf() and strtod() routines did with them.

If I'm wrong in that analysis, please correct me.

It's true that one couldn't portably rely on passing NaNs through
Tcl, but it's certainly possible that this worked on at least
some systems.  This incompatibility will strike there.  For those
users, if we don't rethink this, we need a good explanation and
an alternative to offer.

>  An extension that is prepared to handle NaNs gracefully
>  can check this case with a few lines of code - the way,
>  for instance, that the 'FormatNumber' function in tclBinary.c
>  does.

If the alternative is to be along these lines, I think it
would be better to make TclGetNumberFromObj() public and
offer that.  (That's probably a good idea anyway.)

For the sake of getting 8.5a4 done, I'm going to omit this
issue from the Tcl_GetDoubleFromObj documentation revisions.

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



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
Donald G Porter
Kevin Kenny
Donald G Porter

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved