.
D 2001-08-17T12:27:44
J assignee hobbs
J cmimetype text/plain
J comment Tcl\s8.3.1\sand\slater.\n\nConcise\ssample.\n\n%\sexpr\s400000000\n400000000\n%\sexpr\s4000000000\n-294967296\n%\sexpr\s40000000000\ninteger\svalue\stoo\slarge\sto\srepresent\n\nThe\stext\sabove\sgives\sconcise\sexample\sof\sproblem.\s\sHere\s\nis\smore\sfrom\snewsgroup\sposts.\n\nPlease\snotify\sme\sby\se-mail\swhen\syou\sbegin\sworking\son\s\nthis\sproblem.\s\sThat\sway,\sif\sI\sbegin\swork\son\sit,\sit\s\nwon't\sbe\swasted\seffort\s(i.e.\swe\sshould\snot\shave\sa\s\ncollision\sof\seffort).\n\nDave\sAshley\s([email protected])\n--------------------------\n\nWith\sTcl\s8.3.1\s(but\sit\smay\shave\sbeen\scorrected\sby\s\nnow),\sWindows\splatform,\nstatic\sbuild,\si.e.\smy\scompilation\sunder\sMicrosoft\s\nVisual\sC++.\n\nI\sdiscovered\sthat\swhen\sI\scall\sthe\slibrary\sfunction:\n\nTcl_GetIntFromObj()\n\nthere\sare\ssome\svalues\sof\sstrings\sthat\sare\snot\s\nconverted\sto\sintegers\ncorrectly.\n\nHere\sare\sthe\sexamples:\n\nThe\sstring\s"-400000000"\s(there\sare\seight\szeros\sthere)\s\nis\sconverted\ncorrectly.\n\nThe\sstring\s"-4000000000"\s(there\sare\snine\szeros\sthere)\s\nis\sconverted\sto\n294967296,\sbut\sTCL_OK\sis\sreturned.\n\nThe\sstring\s"-40000000000"\s(there\sare\sten\szeros\sthere)\s\ncauses\sTCL_ERROR\sto\sbe\nreturned.\n\nThere\sis\sa\swindow\sof\spositive\sand\snegative\snumbers\s\nwhere\sthe\snumber\sis\nconverted\sincorrectly\sto\sinteger\sformat,\sbut\sTCL_OK\sis\s\nreturned.\s\sThe\nexample\swith\snine\szeros\sis\sin\sthis\swindow.\n\nAnother\smore\ssimple\sway\sto\sshow\sthe\sbug\sis:\n%\sexpr\s-400000000\s*\s1\n-400000000\n%\sexpr\s-4000000000\s*\s1\n294967296\n%\sexpr\s-40000000000\s*\s1\ninteger\svalue\stoo\slarge\sto\srepresent\n%\sexpr\s400000000\s*\s1\n400000000\n%\sexpr\s4000000000\s*\s1\n-294967296\n%\sexpr\s40000000000\s*\s1\ninteger\svalue\stoo\slarge\sto\srepresent\n%\n\nThe\sbug\sis\sin\sthe\sfunction.\nSetIntFromAny(interp,\sobjPtr)\n
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter dtashley
J subsystem 11.\sConversions\sfrom\sString
J title Some\sStrings\sIncorrectly\sConvrtd\sTo\sInts
J type Bug
K 452032ffffffffffffffffffffffffffffffffff
U dtashley
Z ad4114259d81a485dd6d79aba2d2d84f