.
D 2016-10-03T22:17:53.830
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment The\sdocumentation\sfor\s<code>expr</code>\sprovides\sseven\srules\sfor\soperand\r\nsyntax.\s\sOf\sthose,\sthe\svalue\s<code>0x12</code>\smatches\srule\s1,\sand\sonly\srule\s1:\r\n"...\sa\snumeric\svalue,\seither\sinteger\sor\sfloating-point".\s\sTherefore,\r\n<code>0x12</code>\sis\sunambiguously\sa\snumeric\svalue.\s\sThe\sstring\srepresentation\r\nof\s<code>0x12</code>\sis\s<code>18</code>,\sas\sillustrated\sby\sthe\sresult\sof\r\n<code>[expr\s0x12]</code>.\s\sFurthermore,\sthe\sdocumentation\sstates\sthat\soperands\r\nthat\sare\snot\snumeric\sor\sboolean\smust\sbe\squoted.\s\sIt's\swell-accepted\sthat\sonly\r\nnumeric\soperands\scan\sappear\sunquoted\sin\san\sexpression.\s\sFinally,\sthe\r\ndocumentation\sstates\sthat\sin\sorder\sto\scompare\sa\snumeric\soperand\sto\san\soperand\r\nthat\scan't\sbe\sinterpreted\sas\snumeric,\sthe\sstring\srepresentation\sfor\sthe\snumeric\r\noperand\sis\sgenerated.\s\sConsider\r\n\r\n<code><verbatim>\r\nexpr\s{{0y}\s>\s0x12}\r\n</verbatim></code>\r\n\r\n.\sSince\s<code>0x12<code>\sis\snumeric,\sand\sits\sstring\srepresentation\sis\r\n<code>18</code>,\sthe\sprevious\scommand\sshould\sproduce\sthe\ssame\sresult\sas\r\n\r\n<code><verbatim>\r\nexpr\s{{0y}\s>\s{18}}\r\n</verbatim></code>\r\n\r\n.\sHowever,\sthis\sisn't\sthe\scase.\s\sThe\sresult\sof\sthe\sfirst\scommand\sis\s`1`,\sand\r\nthe\sresult\sof\sthe\ssecond\sis\s`0`.
J foundin 8.5
J is_private 0
J login pooryorick
J priority 5\sMedium
J private_contact 4403a7f74e8fccbce1943bdd674d5d936b16d5b8
J resolution None
J severity Minor
J status Open
J submitter pooryorick
J subsystem 16.\sCommands\sA-H
J title expr,\sliteral\snumeric\svalues,\sand\sstring\scomparisons
J type Bug
K ef5373e6fa0617ee02f201c6c8f41746678c5afb
U pooryorick
Z 51dd3578799d06483591c2de5450db76