.
D 2015-02-02T08:21:54.131
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment %\sbinary\sscan\s[binary\sformat\sR\sInf]\sR\sx\r\n%\sset\sx\r\n3.4028234663852886e+38\r\n\r\nThis\sis\sFLT_MAX\s-\ssee\sthe\sbit\spattern\sdescribed\snear\sthe\sbottom\sof\shttp://wiki.tcl.tk/41088\r\n\r\nThe\sissue\sseems\sto\sbe\sthe\stest\sat\shttp://core.tcl.tk/tcl/artifact/fee105a45aaf25a3?ln=1915-1917\r\n\r\nBy\smy\sreading,\sthe\scondition\sshould\sbecome:\r\n\r\n\s\s\s\sif\s(!isinf(dvalue)\s&&\s(fabs(dvalue)\s>\s(double)FLT_MAX))\r\n\r\nIn\sthe\schat,\skbk\sadds:\r\n\r\nIf\sthe\sfloat64\sis\sless\sthan\sFLT_MAX\s+\s1/2\sulp,\sthen\sit's\snot\sa\s'true'\soverflow,\sand\sit\sshould\s[binary\sformat]\sto\sFLT_MAX.\sGreater\sthan\sthat,\sand\sit\sshould\sbe\sInf.\r\n\r\nExact\sFLT_MAX\s+\s1/2\sulp\sshould\sround\sto\sFLT_MAX\s(round\sto\seven).\r\n\r\nI\shave\simplemented\sa\sfix\sin\shttp://chiselapp.com/user/aspect/repository/tcl/timeline?r=aspect-binary-float-inf\r\n\r\nThe\sfirst\scheckin\shttp://chiselapp.com/user/aspect/repository/tcl/ci/f4d7334db9\scorrects\sbehaviour\sfor\sInf/-Inf\sonly,\sand\sadds\ssome\stests.\r\n\r\nFollowing\scheckins\sfollow\skbk's\sadvice\s(I\shope!)\sto\scorrect\sout-of-range\srounding\sbehaviour,\sbut\swith\ssome\squestionable\saspects:\r\n\r\n\s\s*\sc99\sreliance\sfor\sINFINITY\r\n\s\s*\sFLT_MAX+1/2ulp\sis\scalculated\swith\san\sexpression\sI\sdon't\sentirely\strust\r\n\s\s*\schanges\sresults\s(!!)\sof\ssome\sexisting\stests\swhich\sexpect\srounding\sto\sFLT_MAX\r\n\r\nThe\sincluded\stests\sshould\sbe\scomplete,\sbut\sthose\sin\sthe\s3rd\scheckin\sdon't\sconform\sto\sconventions\sof\stheir\sneighbours.\r\n\r\nAnother\sway\sto\screate\sFLT_MAX+1/2ulp\sfor\scomparison\swould\sbe\sas\sfollows,\sthough\sI\scan't\svouch\sfor\sits\sportability.\r\n\r\n\s\s\s\s/*\ssmallest\sdouble\sthat\sshould\sround\sto\s+Inf\s*/\r\n\s\s\s\sdouble\sflt_min_inf\s{}\s{\r\n\s\s\s\s\s\s\s\suint64_t\sbits\s=\s0x47effffff0000001;\r\n\s\s\s\s\s\s\s\sreturn\s*(double*)&bits;\r\n\s\s\s\s}\r\n\r\n\s\s\s\s/*\slargest\sdouble\sthat\sshould\sround\sto\sFLT_MAX\s*/\r\n\s\s\s\sdouble\sflt_max_dbl\s{}\s{\r\n\s\s\s\s\s\s\s\suint64_t\sbits\s=\s0x47effffff0000000;\r\n\s\s\s\s\s\s\s\sreturn\s*(double*)&bits;\r\n\s\s\s\s}\r\n\r\nLet\sme\sknow\sif\sthere's\sanything\sI\scan\sdo\sto\smake\sthis\spatch\seasier\sto\sconsume.
J foundin 8.6.3
J is_private 0
J login anonymous
J priority 5\sMedium
J private_contact cb02a4a25e8da92f2790bc307bf01ef24ce6053e
J resolution None
J severity Minor
J status Open
J submitter anonymous
J subsystem 48.\sNumber\sHandling
J title [binary\sformat\sR\sInf]\sstores\sFLT_MAX
J type Bug
K 85ce4bf928cd9a40064aa5b36e7033184dd5379a
U anonymous
Z b69dab192ead8e25fdb15cd55809c403