Overview
| Artifact ID: | 4d29d813a06d628e4da59ef9abf22c2b7bc1a213 |
|---|---|
| Ticket: | 3105247fffffffffffffffffffffffffffffffff
-NaN? |
| User & Date: | dkf on 2010-11-29 23:37:35 |
Changes
- icomment:
IMO, there's two cases to consider: * externally-sourced NaNs * internally-sourced NaNs In the former case, they should survive a trip in (via [binary scan]) and out again (via [binary format]) without any change to their bit pattern, and while in Tcl should be understood to work like a NaN by being not numerically-equal to anything else; like that, if we get one from outside because of a blunder elsewhere, we can just pass it on correctly. In the latter case, we should endeavor to ensure that they are trapped as errors at as early an opportunity as possible; this is indeed the case with NaN values that pass through [expr]. Outside expressions, they're just strings. Overall, that means neither Tcl_NewDoubleObj nor Tcl_GetDoubleFromObj has to not choke on them but Tcl_ExprObj must not like them, which is current behavior. The actual string format of NaN-values isn't nearly so important; we wouldn't care except we want to keep the general interconvertibility of doubles with strings so that we can pass them back out again even in the face of shimmering (e.g., if some nitwit uses [llength] on them, it shouldn't break the round trip rules). Given all the above, I don't care too much about changing things in this area and I trust kbk to get things right. I particularly trust him to deal with corrections to the TIP, since I believe that considerations w.r.t. the sign of NaN were not foremost in our minds when the decision was taken!
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"