Skip to content
Tcl Source Code Artifact [c5608dbd72]
Login

Artifact [c5608dbd72]

Artifact c5608dbd720b64dd58f0a06e4ecb9c9ac326085f4dca7b14539ce3e4e884ddfd:

Ticket change [c5608dbd72] - Ticket [63530267aa576587|63530267aa] <i>lseq.test fail on i386</i> status still Open with 3 other changes by emiliano on 2023-05-07 20:27:05.
D 2023-05-07T20:27:05.726
J icomment I\sthink\sthe\stest\sitself\sis\smisguided,\sas\sit\sdepends\son\sthe\s(sometimes\srather\ssurprising)\sbehaviour\sof\sfloating\spoint\smath.\r\n\r\nBesides\snot\sgetting\sthe\ssame\sactual\snumbers\son\smy\smachine,\sI\salso\snoted\sthat\sI\sdon't\sget\sthe\slast\s(aka\send)\sargument,\s29.9\sin\sthis\scase.\r\n\r\nI\straced\sthis\sproblem\sto\sgeneric/tclArithSeries.c\s,\sline\s335\r\n\r\n\tlen\s=\s(dend\s-\sdstart\s+\sdstep)/dstep;\r\n\r\nlen\sis\sa\sTcl_WideInt\sargument,\swhile\sthe\sothers\sare\sdoubles.\s\r\n\r\nFor\sthe\svalues\son\sthis\stest\sit\sshould\sbe\r\n\r\n%\sexpr\s{(29.9\s-\s1.1\s+\s0.3)\s/\s0.3}\r\n97.0\r\n\r\nbut\sa\sprintf()\stells\sme\sthat\slen\sis\s96.\sA\ssecond\sprintf\sconfirms\sthat\s\r\n\r\n\t((dend\s-\sdstart\s+\sdstep)/dstep)\s-\s97.0\r\n\r\nequals\s-0.00000000000000147798,\sso\swhen\sassigned\sto\san\sintegral\svalue\r\nit\sgets\spromoted\sto\s96,\snot\s97,\sthe\sseries\sresulting\san\selement\sshort.\r\n\r\nI\sthink\sthe\sprecision\sissue\scould\sbe\ssolved\swith\s[format],\smaybe\susing\r\n\r\n%\slmap\sx\s[lseq\s1.1\s29.9\s0.3]\s{format\s%g\s$x}\r\n1.1\s1.4\s1.7\s2\s2.3\s2.6\s2.9\s3.2\s3.5\s3.8\s4.1\s4.4\s4.7\s5\s5.3\s5.6\s5.9\s6.2\s6.5\s6.8\s7.1\s7.4\s7.7\s8\s8.3\s8.6\s8.9\s9.2\s9.5\s9.8\s10.1\s10.4\s10.7\s11\s11.3\s11.6\s11.9\s12.2\s12.5\s12.8\s13.1\s13.4\s13.7\s14\s14.3\s14.6\s14.9\s15.2\s15.5\s15.8\s16.1\s16.4\s16.7\s17\s17.3\s17.6\s17.9\s18.2\s18.5\s18.8\s19.1\s19.4\s19.7\s20\s20.3\s20.6\s20.9\s21.2\s21.5\s21.8\s22.1\s22.4\s22.7\s23\s23.3\s23.6\s23.9\s24.2\s24.5\s24.8\s25.1\s25.4\s25.7\s26\s26.3\s26.6\s26.9\s27.2\s27.5\s27.8\s28.1\s28.4\s28.7\s29\s29.3\s29.6\r\n\r\nNote\sthat\son\sthis\smachine,\susing\s29.900000000000001\sinstead\sof\s29.9\sis\senough\sto\sget\sthe\sextra\selement.
J login emiliano
J mimetype text/plain
K 63530267aa576587c112620515a2bf68870400e3
U emiliano
Z 667f8fd82df3ccf73704c57d47653b08