Overview
| Artifact ID: | 475e6939c5b31eae8eae8af05bc8898b75a68f7a |
|---|---|
| Ticket: | 3105247fffffffffffffffffffffffffffffffff
-NaN? |
| User & Date: | nijtmans on 2010-12-09 15:08:43 |
Changes
- icomment:
dkf wrote: >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). Just found out that that currently is not the case: Tcl does not have signaling NaN's, they are silently converted to quiet NaN's. This is even mentioned in the TIP. Here is a test case showing that: test binary-63.5 {NaN roundtrip} ieeeFloatingPoint { binary scan [binary format w 0x7ff0000000000001] q d binary scan [binary format q $d] w w llength $d; #force shimmering binary scan [binary format q $d] w r list $d [format 0x%016lx $w] [format 0x%016lx $r] } {NaN(1) 0x7ff0000000000001 0x7ff8000000000001} So, in a normal roundtrip, the given bit pattern is converted to NaN(1), and back with the same result. When shimmering, bit 51 is magically set, changing the signaling NaN to a quiet NaN. This opens up (in my opion) to handle the sign bit the same way as the signaling bit: Provide we decide that the sign bit has no meaning, just as the signaling bit. I don't think this is in any way in conflict with TIP #249, nor with IEEE 754, but I would like to hear other opinions about this. Is the round-trip with shimmering important? Should - in stead - Tcl start to represent signalling NaN's as "sNaN" (as allowed, but not required by IEEE 754) ??? Here is my last patch (I hope) still open for discussion. - login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"