.
D 2010-02-22T17:45:35
J foundin obsolete:\s8.5.8
J icomment Added\ssome\smore\stests,\sjust\sto\sprove\sthat\sthe\sTCL_NUMBER_LONG\swas\snot\squite\sright\seither.\sThe\sproblem\nis\sthat\sin\sieee\sfloating\spoint\smath,\s-0.0\s==\s0.0\sgives\strue!\sThis\smeans\sthat\syou\scannot\sreally\sdistinguish\n-0.0\sand\s0.0\sin\sfloating\spoint\smath.\n\nLooking\sat\sthe\stest\scases,\sthe\srule\sseems\sto\sbe:\n-\sIf\sthe\sinput\slooks\snegative,\stake\sthe\snegative\sof\sthe\soutput\sand\stake\sthat\sas\sa\sresult.\n-\sotherwise,\stake\sthe\sunchanged\sinput.\n\nNo,\swhat\slooks\snegative?\sFor\sexample,\s-0.0\sand\s-0\slook\snegative,\sbut\sreally\sare\nnot:\sthey\sare\sboth\sforms\sof\szero!\sStill,\swe\swant\sto\soutput\sresp.\s0.0\sand\s0\sin\sthose\ncases.\sSo,\swe\sneed\sto\sdistinguish\sbetween\s-0.0\sand\s0.0\s(in\sthe\sfloat\scase)\sand\nbetween\s0\sand\s-0\s(in\sthe\slong\scase).\sHow\sdo\swe\sdo\sthat.\n\nIn\sthe\sfloat\scase,\swe\scan\suse\smemcmp().\sIn\sthe\slong\scase,\sI\ssee\sno\sother\sway\sto\slook\nfor\s´-´\scharacters\s(if\sthere\sis\sa\sstring\srepresentation).\sAnyway,\sthis\sway\sI\scould\nmake\sall\stest\scases\spass.\n\nFor\s8.4\sthe\sstory\sis\sa\slittle\sbit\sdifferent.\sThe\sonly\s'mistake'\swas\sthat\sabs(-0.0)\sreturns\n-0.0,\swhich\sis\sin\sfact\scorrect,\sbut\snot\sexpected\sregarding\sthe\sabove\srules.\sNumbers\nlike\s1e-324\sresult\sin\san\sunderflow\simmediately\sin\s8.4,\sit\sseems\snot\sworth\sto\nfix\sthat.\sBut\sthe\sabs(-0.0)\scase\sstill\scan\sbe\sfixed,\stherefore\sleaving\sthis\sissue\sopen.\n
J login nijtmans
J mimetype text/plain
J username nijtmans
K 2954959fffffffffffffffffffffffffffffffff
U nijtmans
Z 494bf2a03da0853d316e87e0a57dbf43