Skip to content
Tcl Source Code Artifact [475e6939c5]
Login

Artifact [475e6939c5]

Artifact 475e6939c5b31eae8eae8af05bc8898b75a68f7a:

Ticket change [475e6939c5] - Ticket [3105247fffffffff|3105247fff] <i>-NaN?</i> status still Pending with 4 other changes by nijtmans on 2010-12-09 15:08:43.
D 2010-12-09T15:08:43
J icomment dkf\swrote:\n>we\swouldn't\scare\sexcept\swe\swant\sto\skeep\sthe\sgeneral\sinterconvertibility\sof\n>doubles\swith\sstrings\sso\sthat\swe\scan\spass\sthem\sback\sout\sagain\seven\sin\sthe\n>face\sof\sshimmering\s(e.g.,\sif\ssome\snitwit\suses\s[llength]\son\sthem,\sit\n>shouldn't\sbreak\sthe\sround\strip\srules).\n\nJust\sfound\sout\sthat\sthat\scurrently\sis\snot\sthe\scase:\sTcl\ndoes\snot\shave\ssignaling\sNaN's,\sthey\sare\ssilently\nconverted\sto\squiet\sNaN's.\sThis\sis\seven\smentioned\sin\nthe\sTIP.\sHere\sis\sa\stest\scase\sshowing\sthat:\n\ntest\sbinary-63.5\s{NaN\sroundtrip}\sieeeFloatingPoint\s{\n\s\s\s\sbinary\sscan\s[binary\sformat\sw\s0x7ff0000000000001]\sq\sd\n\s\s\s\sbinary\sscan\s[binary\sformat\sq\s$d]\sw\sw\n\s\s\s\sllength\s$d;\s#force\sshimmering\n\s\s\s\sbinary\sscan\s[binary\sformat\sq\s$d]\sw\sr\n\s\s\s\slist\s$d\s[format\s0x%016lx\s$w]\s[format\s0x%016lx\s$r]\n}\s{NaN(1)\s0x7ff0000000000001\s0x7ff8000000000001}\n\nSo,\sin\sa\snormal\sroundtrip,\sthe\sgiven\sbit\spattern\sis\sconverted\nto\sNaN(1),\sand\sback\swith\sthe\ssame\sresult.\sWhen\sshimmering,\nbit\s51\sis\smagically\sset,\schanging\sthe\ssignaling\sNaN\sto\sa\nquiet\sNaN.\n\nThis\sopens\sup\s(in\smy\sopion)\sto\shandle\sthe\ssign\sbit\sthe\ssame\nway\sas\sthe\ssignaling\sbit:\sProvide\swe\sdecide\sthat\sthe\ssign\sbit\nhas\sno\smeaning,\sjust\sas\sthe\ssignaling\sbit.\n\nI\sdon't\sthink\sthis\sis\sin\sany\sway\sin\sconflict\swith\nTIP\s#249,\snor\swith\sIEEE\s754,\sbut\sI\swould\slike\nto\shear\sother\sopinions\sabout\sthis.\sIs\sthe\sround-trip\nwith\sshimmering\simportant?\sShould\s-\sin\sstead\s-\nTcl\sstart\sto\srepresent\ssignalling\sNaN's\sas\s"sNaN"\n(as\sallowed,\sbut\snot\srequired\sby\sIEEE\s754)\s???\n\nHere\sis\smy\slast\spatch\s(I\shope)\sstill\sopen\sfor\sdiscussion.\n
J login nijtmans
J mimetype text/plain
J username nijtmans
K 3105247fffffffffffffffffffffffffffffffff
U nijtmans
Z 0cc0921f03467c42ce5e8ecd5cd92b80