Skip to content
Tcl Source Code Artifact [5461560ec6]
Login

Artifact [5461560ec6]

Artifact 5461560ec6ad9049876a70c1e786f49b04f240e9342504a483778ab7a3086ad7:

Ticket change [5461560ec6] - New ticket [aa69bce71e214872|aa69bce71e] <i>expr comparison operator result does not follow the documentation</i>. by anonymous on 2024-03-11 21:26:09.
D 2024-03-11T21:26:09.099
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-plain
J comment I\swanted\sto\sknow\sif\sthe\s'expr'\scommand\swhen\susing\sthe\s<\soperator\scompares\sits\sarguments\sas\snumbers\sor\sas\sstrings.\sSo\sI\schecked\sthe\sdocumentation\sfor\sexpr.\sThis\sis\swhat\sit\ssays:\r\n\r\n>>\sThese\soperators\smay\sbe\sapplied\sto\sstrings\sas\swell\sas\snumeric\soperands,\sin\swhich\scase\sstring\scomparison\sis\sused.\s<<\r\n\r\nhttps://tcl.tk/man/tcl/TclCmd/expr.htm#M12\r\n\r\nFrom\sthis,\sI\sexpect\sthat\sI\scan\scompare\stwo\sstring,\sor\sI\scan\scompare\stwo\snumbers,\sboth\swill\sbe\sok\sfor\sthe\soperator.\sIt\sshould\salways\scompare\sas\sstrings\s-\sas\sit\ssays\sthat\sstrig\scomparison\sis\sused.\r\n\r\nBut\sthe\simplementation\sdoes\snot\sfollow\sit\r\n\r\n%\sexpr\s{12<2}\r\n0\r\n%\sexpr\s{"12"<"2"}\r\n0\r\n\r\nWhen\scompared\sas\sstrings\sthe\sfirst\sshould\sbe\ssmaller\sthan\sthe\ssecond.\sThe\sresult\sshould\sbe\s1.\r\n\r\nThe\sstring\scomparison\sshould\sbe\slike\sthis:\r\n\r\n%\sstring\scompare\s12\s2\r\n-1\r\n\r\nI.e.\sthe\sfirst\sstring\sis\sless\sthan\sthe\ssecond.\r\n\r\nOr\smaybe\sthe\sdocumentation\sis\swrong?
J foundin 8.6
J is_private 0
J login anonymous
J priority 5\sMedium
J private_contact eb1592a11067c658ae62686070571429a9282829
J resolution None
J severity Minor
J status Open
J submitter anonymous
J subsystem 16.\sCommands\sA-H
J title expr\scomparison\soperator\sresult\sdoes\snot\sfollow\sthe\sdocumentation
J type Bug
K aa69bce71e214872af462de3a3050a46eec61385
U anonymous
Z 1cc29a7ef39e91ba18ef905d325391d0