archives

« Bugzilla Issues Index

#126 — S15.8.2.16_A6/7 expect implementation-defined behaviour


Math.sin "returns an implementation-dependent approximation to the sine of x". As such, any Number value is allowable (going for a constant value could be an approximation, though a not very useful one, but would be implementation-defined).

There are similar tests for the other trig functions.

(To be fair, these are more tests which are probably useful to have somewhere, even though they aren't required for conformance.)


It's a shame to disable these as they provide quite a bit of value, but you're correct that they're invalid as-per ES5. I've disabled all of the following in source control plus a few more that were obviously verifying implementation defined behavior:
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.10_log\S15.8.2.10_A6.js(7): * @assertion: Math.log, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.10_log\S15.8.2.10_A6.js(19):assertion: "Math.log, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.13_pow\S15.8.2.13_A24.js(7): * @assertion: Math.pow, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.13_pow\S15.8.2.13_A24.js(19):assertion: "Math.pow, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.16_sin\S15.8.2.16_A7.js(7): * @assertion: Math.sin it is recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.16_sin\S15.8.2.16_A7.js(19):assertion: "Math.sin it is recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.17_sqrt\S15.8.2.17_A6.js(7): * @assertion: Math.sqrt, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.17_sqrt\S15.8.2.17_A6.js(19):assertion: "Math.sqrt, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.18_tan\S15.8.2.18_A7.js(7): * @assertion: Math.tan, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.18_tan\S15.8.2.18_A7.js(19):assertion: "Math.tan, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.2_acos\S15.8.2.2_A5.js(7): * @assertion: Math.acos, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.2_acos\S15.8.2.2_A5.js(19):assertion: "Math.acos, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.3_asin\S15.8.2.3_A6.js(7): * @assertion: Math.asin, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.3_asin\S15.8.2.3_A6.js(19):assertion: "Math.asin, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.4_atan\S15.8.2.4_A6.js(7): * @assertion: Math.atan, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.4_atan\S15.8.2.4_A6.js(19):assertion: "Math.atan, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.5_atan2\S15.8.2.5_A24.js(7): * @assertion: Math.atan2, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.5_atan2\S15.8.2.5_A24.js(19):assertion: "Math.atan2, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.7_cos\S15.8.2.7_A7.js(7): * @assertion: Math.cos it is recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.7_cos\S15.8.2.7_A7.js(19):assertion: "Math.cos it is recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.8_exp\S15.8.2.8_A6.js(7): * @assertion: Math.exp, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm;
G:\262\test262\test\suite\sputnik_converted\15_Native\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.8_exp\S15.8.2.8_A6.js(19):assertion: "Math.exp, recommended that implementations use the approximation algorithms for IEEE 754 arithmetic contained in fdlibm",

Mark - could you please move these to a "Sputnik\BestPractices"-esque directory? Then these won't be on the live website, but will be available to all implementers.


> Mark - could you please move these to a "Sputnik\BestPractices"-esque
> directory? Then these won't be on the live website, but will be available to
> all implementers.

Yes, that's a good idea.


Maybe also worthwhile to have something in excludelist.xml to tell apart bogus tests from not-mandated-by-standard-but-preferable tests.


The call was made at the last TC-39 meeting to re-enable these tests since we must have some sort of coverage for these math functions, and also because the tests have the capability to loosen their precision via the 'prec' global variable.

Was there any specific OS/architecture/browser combo you saw these tests failing against? Believe they were actually passing against Win7/AMD64/Opera when I disabled them back in July. Maybe ARM? If you can give me a precise (and reasonable:) ) value for 'prec' that works for you, I'll go ahead and modify the tests to use this instead.

In the long run, I'm optimistic that ES6 will be more stringent with respect to precision of these math functions; particularly with APIs like IndexDB floating around.


It was just a bug in an internal build that caused these to fail, so I have little opinion about what prec should be.