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
[TCLCORE] TIP 132 and NaN
by Donald G Porter other posts by this author
Apr 18 2006 11:04AM messages near this date
[TCLCORE] Tcl/Tk 8.4.13 released | [TCLCORE] Re: TIP 132 and NaN
Been working on updating 8.5 docs concerning all the numerics changes,
and ran across something I need more people to see and comment on.

TIP 132 proposes, in part,

  "Tcl_GetDoubleFromObj shall treat +Inf and -Inf as it does any
   ordinary floating point number, and return an error for NaN."
   
And the implementation of Tcl_GetDoubleFromObj() has followed that
prescription and now returns TCL_ERROR when the Tcl_Obj holds a NaN
value.

The trouble I have with that is this code example:

    objPtr = Tcl_NewDoubleObj(d1);
    code = Tcl_GetDoubleFromObj(interp, objPtr, &d2);
    
In all Tcl 8 releases up to now, a programmer could rely on code now
having the value TCL_OK, and the variable d2 holding a copy of the
variable d1.

With the TIP 132 change, whenever d1 holds NaN, code will get TCL_ERROR
and d2 will remain unchanged.

I think this means that extensions lose the ability to pass the NaN
value through Tcl.  I have to believe that will make someone, somewhere
unhappy.

It seems strange to me that we drop this capability just at the time
when we've purged all the problems with converting a NaN value to and
from a string rep.  Just when shimmering will no longer cause us 
trouble, we just opt out of supporting this value?

Can someone confirm this incompatibility, and explain to me again what
the purpose of this change was?  What we gain in exchange for this loss?

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



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&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