.
D 2003-01-09T00:19:05
J assignee msofer
J cmimetype text/plain
J comment \n====\sexecute-7.30\sWide\sint\shandling\sin\sfunction\scall\sFAILED\n====\sContents\sof\stest\scase:\n\n\s\s\s\sset\sx\s0x12345687123456\n\s\s\s\sincr\sx\n\s\s\s\sexpr\s{sin($x)\s==\ssin(double($x))}\n\n----\sResult\swas:\nfloating-point\svalue\stoo\ssmall\sto\srepresent\n----\sResult\sshould\shave\sbeen\s(exact\smatching):\n1\n----\sTest\sgenerated\serror;\sReturn\scode\swas:\s1\n----\sReturn\scode\sshould\shave\sbeen\sone\sof:\s0\s2\n====\sexecute-7.30\sFAILED\n\nThere\sare\sseveral\sproblems\shere.\n\nFirst\snote\sthat\ssin(x)\s==\ssin\s(x\s+\s2*pi),\sso\sin\sorder\sto\s\ncompute\sthe\ssin()\sof\sa\svalue\syou\sneed\sto\sknow\sits\nprecision\sat\sa\sscale\sconsiderably\sless\sthan\s2*pi.\n\nFor\slarge\snumbers,\sdifferences\sof\s2*pi\scan\sget\slost\nin\sthe\slow\sorder\sbits\sof\sthe\sfloating\spoint\srep,\sor\snot\nrepresented\sat\sall.\s\sTaking\sthe\ssin()\sof\ssuch\simprecise\nnumbers\sis\sessentially\smeaningless.\n\nFor\sthis\sreason,\son\sthe\sSGI\splatform,\sfor\sany\sx\s>\s2^50,\nsin(x)\sreturns\s0,\sand\serrno\sis\sset\sto\sERANGE.\n\nIn\sthe\stest\sabove,\sx\s>\s2^50.\s\sIf\sall\sthat\sis\sneeded\sfor\nthis\ntest\sis\sa\swide\sint\sargument,\sthen\sreplacing\sx\swith\ssome\nvalue\sless\sthan\s2^50,\sbut\sgreater\sthan\s2^31\s(thus\swide)\nshould\sfix\sthe\stest.\n\nIt\sis\sunfortunate\sthat\sthe\sSGI\ssin()\sfunction\sraises\sERANGE\nin\sthis\scircumstance,\sI\sthink\sit\swould\smake\smore\ssense\nto\sraise\sEDOM.\s\sAnyhow,\sthe\scombination\sof\sERANGE\sand\nvalue\s==\s0\sgets\sinterpreted\sby\sTcl\sin\sTclExprFloatError()\nas\sa\sfloating\spoint\sunderflow\s("floating-point\svalue\ntoo\ssmall\nto\srepresent"),\sbut\sthat's\snot\saccurate\sin\sthis\scase.\s\nWould\nbe\snice\sto\sget\sa\sbetter\serror\smessage\sfor\sthis.
J foundin obsolete:\s8.4.1
J priority 5\sMedium
J resolution None
J status Open
J submitter dgp
J subsystem 47.\sBytecode\sCompiler
J title execute-7.30\sfails\son\sSGI
J type Bug
K 664775ffffffffffffffffffffffffffffffffff
U dgp
Z 30924fe97379f0775cdf72ae4fd28c5c