3 ms·
I'll repeat once again: do your engineering homework and decide if you can live with a spec that changes the Nth digit of precision, or if you need more precisi
by 0xff00ffee 7y ago
I'll repeat once again: do your engineering homework and decide if you can live with a spec that changes the Nth digit of precision, or if you need more precision roll your own. If you're just making an SVG rotate, then why are you arguing?
- zamadatix 7y agoThe Nth digit in this case is digit 0, as the article points out. You're interpreting it as the usual "floating point is inaccurate" article/conversation instead of what it actually is - a surprising detail in the ECMAScript standard.
- edflsafoiewq 7y agoIs it surprising? What languages specify the exact result of mathematical functions?
- zamadatix 7y agoE.g. java.lang.Math spends a lot of time defining the required accuracy of functions https://docs.oracle.com/javase/7/docs/api/java/lang/Math.html https://docs.oracle.com/javase/7/docs/api/java/lang/Math.htm...
- 0xff00ffee 7y agoIt absolutely is filed under "FP is inaccurate". If you need increased precision beyond a few digits, you must approach the problem armed with numerical computation knowledge and not rely on libraries or generic implementations: even between versions. It's not a surprise, its why the Numerical Recipes books are so famous. (Heck it's even discussed in Abrash's Graphics Programming Book!) I guess this article is more valuable that I expected: it is exposing some really glaring flaws in what people expect from their underlying language. Kinda scary, but I guess it is better late then never to learn the basics.
- zamadatix 7y agoHow is it filed under "FP is inaccurate" if it can be fixed by choice of algorithm and is about algorithms changing? Would be true of fixed point as well. Also it's generally considered poor form to continually talk about people needing to learn the basics/go to school/think like an engineer on HN - generally the focus here is on the content not on how you view the author/readers.