.
D 2000-10-26T00:52:32
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s1384\sBug\nVersion:\s8.0.3\nSubmitDate:\s'1999-03-02'\nLastModified:\s'1999-08-07'\nSeverity:\sMED\nStatus:\sClosed\nSubmitter:\spat\nChangedBy:\shobbs\nOS:\sHP-UX\nOSVersion:\s10.20\nMachine:\sOther\nFixedDate:\s'2000-10-25'\nClosedDate:\s'1999-08-07'\n\n\nName:\nBob\sFletcher\n\nExtensions:\nexpect\n\nCustomShell:\nNone\n\nReproducibleScript:\n#!/bin/sh\n#\sthe\snext\sline\srestarts\susing\swish\s\sexec\swish\s"$0"\s"$@"\n\nfor\s{set\si\s-10}\s{$i\s<=\s10}\s{incr\si}\s{\n\s\s\s\s\s\s\s\sset\sx\s$i\n\s\s\s\s\s\s\s\sputs\s"i\s$i\s[expr\s{$i%10}]\s$x\s[expr\s{fmod($x,10.)}]"\n}\s\s\s\s\s\s\s\nexit\n\nObservedBehavior:\nThis\sis\sthe\scl8.03\soutput\sfor\sthis\sexpr\s%\stest.\ni\s-10\s0\s-10\s0.0\ni\s-9\s1\s-9\s-9.0\ni\s-8\s2\s-8\s-8.0\ni\s-7\s3\s-7\s-7.0\ni\s-6\s4\s-6\s-6.0\ni\s-5\s5\s-5\s-5.0\ni\s-4\s6\s-4\s-4.0\ni\s-3\s7\s-3\s-3.0\ni\s-2\s8\s-2\s-2.0\ni\s-1\s9\s-1\s-1.0\ni\s0\s0\s0\s0.0\ni\s1\s1\s1\s1.0\ni\s2\s2\s2\s2.0\ni\s3\s3\s3\s3.0\ni\s4\s4\s4\s4.0\ni\s5\s5\s5\s5.0\ni\s6\s6\s6\s6.0\ni\s7\s7\s7\s7.0\ni\s8\s8\s8\s8.0\ni\s9\s9\s9\s9.0\ni\s10\s0\s10\s0.0\n\nThis\sis\sthe\soutput\sfrom\sa\ssimilar\sf77\scode.\ni\s-10\s0\s-10.0\s.0\n\si\s-9\s-9\s-9.0\s-9.0\n\si\s-8\s-8\s-8.0\s-8.0\n\si\s-7\s-7\s-7.0\s-7.0\n\si\s-6\s-6\s-6.0\s-6.0\n\si\s-5\s-5\s-5.0\s-5.0\n\si\s-4\s-4\s-4.0\s-4.0\n\si\s-3\s-3\s-3.0\s-3.0\n\si\s-2\s-2\s-2.0\s-2.0\n\si\s-1\s-1\s-1.0\s-1.0\n\si\s0\s0\s.0\s.0\n\si\s1\s1\s1.0\s1.0\n\si\s2\s2\s2.0\s2.0\n\si\s3\s3\s3.0\s3.0\n\si\s4\s4\s4.0\s4.0\n\si\s5\s5\s5.0\s5.0\n\si\s6\s6\s6.0\s6.0\n\si\s7\s7\s7.0\s7.0\n\si\s8\s8\s8.0\s8.0\n\si\s9\s9\s9.0\s9.0\n\si\s10\s0\s10.0\s.0\n\nThe\stcl\sexpr\scommand\sgives,\sfor\snegative\snumbers,\sgives\sdifferent\sanswers\sthan\sthe\s\stcl\sfloating\spoint\s\sfmod\scommand,\sand\sdifferent\sanswers\sfrom\sf77/C.\nWe\swould\sexpect\s%\sto\sgive\sthe\ssame\sanswer\sas\sfmod,\swhen\sthe\sfloating\spoint\sis\sequivalent\sto\san\sint.\s\n\nDesiredBehavior:\nWe\swould\sexpect\s%\sto\sgive\sthe\ssame\sanswer\sas\sfmod,\swhen\sthe\sfloating\spoint\sis\sequivalent\sto\san\sint.\s\n\n\n\nNote\sthe\scomments\sin\stclExecute.c:\n\ncase\sINST_MOD:\n\s\s\s\s/*\n\s\s\s\s\s*\sThis\scode\sis\stricky:\sC\sdoesn't\sguarantee\smuch\sabout\n\s\s\s\s\s*\sthe\squotient\sor\sremainder,\sbut\sTcl\sdoes.\sThe\n\s\s\s\s\s*\sremainder\salways\shas\sthe\ssame\ssign\sas\sthe\sdivisor\sand\n\s\s\s\s\s*\sa\ssmaller\sabsolute\svalue.\n\s\s\s\s\s*/\n\nK&R\sstates\sspecfically\s(p41,\s2nd\sed)\sthat\sthe\ssign\sof\sthe\nresult\sfor\s%\sis\smachine-dependent\sfor\snegative\soperands.\nThus\sTcl\sonly\sformalizes\sthis\swith\sa\smore\sstrict\sdefinition.\s\n--\s08/07/1999\shobbs
J foundin obsolete:\s8.0.3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title %\soperator\sgives\s\sincorrect\sanswer.
J type Bug
K 218045ffffffffffffffffffffffffffffffffff
U nobody
Z 25040682ec260515c800642dbac5c3c0