Skip to content
Tcl Source Code Artifact [b51dce90b3]
Login

Artifact [b51dce90b3]

Artifact b51dce90b39f8063701e95423148f8d0ecc749cb:

Ticket change [b51dce90b3] - Closed ticket [3312466fffffffff|3312466fff]: <i>Bad result in expr command</i> plus 7 other changes by dkf on 2011-06-06 21:19:46.
D 2011-06-06T21:19:46
J closedate 2011-06-06T14:19:46
J closer dkf
J icomment \n\nallow_comments\s-\s1\n\n9.9\sis\snot\srepresentable\sin\sa\sfinite\snumber\sof\sbits\sin\sbinary\sfloating\spoint\s(such\sas\sIEEE\sdouble\sprecision\sfloats,\swhich\sTcl\suses\sunder\sthe\shood\sbecause\sthey've\sgot\sproper\shardware\ssupport\son\svirtually\sall\smodern\shardware)\sso\san\sapproximation\sis\sused.\sThat\sapproximation\sis\svery\sslightly\slarger\sthan\sthe\s"true\svalue"\sand\scauses\sthe\sdifference\syou\ssee;\sthe\s"*\s3"\sjust\smakes\sthe\serror\sthree\stimes\slarger\s(though\sproportionately\sabout\sthe\ssame).\n\nThe\sdifference\sbetween\s8.4\sand\s8.5\sis\sthat\s8.5\suses\sa\sdifferent\sfloating\spoint\snumber\srenderer\sthat\snormally/by-default\savoids\sthe\sworst\sof\sthe\sproblem\s(i.e.,\sit\suses\sthe\sshortest\sdecimal\srepresentation\sthat\swill\sprovide\sthe\sboolean\svalue\sthat\swe've\sgot\sinternally).\sUnfortunately,\sthe\smultiply\sby\s3\shas\sgrown\sthe\serror\sto\sthe\spoint\swhere\sit\scan\sno\slonger\sbe\shidden\sthis\sway.\sOh\swell,\sthat's\slife.\n\nThe\srecommended\sworkaround\sis\sto\suse\s[format\s"%.15g"\s$value]\swhen\sproducing\sa\svalue\sfor\s_display_\sto\susers.\sThe\srest\sof\sthe\stime,\sperfect\sfidelity\sof\svalue\s(which\syou\sget\swith\sthe\scurrent\ssettings,\sunlike\sbefore)\sis\sactually\smore\suseful.\sReally.\n
J login dkf
J mimetype text/plain
J resolution Invalid
J status Closed
J username dkf
K 3312466fffffffffffffffffffffffffffffffff
U dkf
Z 92cccc6ab6212351effec5c5296c3bde