Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That’s a little bit more accuracy than what is needed for this post, but good catch :-) https://www.jpl.nasa.gov/edu/news/2016/3/16/how-many-decimal...


Thats an interestring post, thank you! Do you think that's why for example JavaScripts Math.PI also comes out to 3.141592653589793?


Not really, that's more related to the fixed precision of IEEE 754 floating-point numbers. In any fixed-precision representation there's always a certain representation which happens to be the best approximation of any constant like pi. That's the one you would pick.

However, you could perhaps infer from the article that IEEE 754 double-precision numbers are sufficient for most physical calculations.


It must be either a coincidence or backwards. Math.PI is a double precision floating point number that is set to a closest value of pi that could fit in its 64-bit encoding. https://en.m.wikipedia.org/wiki/Double-precision_floating-po...


Other way around, they use that value because that's the most precision you get with IEEE-754 64-bit floating-point numbers, which is the representation also used by JS for floating-point.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: