Is it possible to return the ENTIRE value of PI (heh, don't think so) using Math.abs(Math.PI)? (What I am asking is, would this work?)
-magicyte
Printable View
Is it possible to return the ENTIRE value of PI (heh, don't think so) using Math.abs(Math.PI)? (What I am asking is, would this work?)
-magicyte
Not sure about that, but I came across this website:
http://www.trans4mind.com/personal_d...king%20Example
Hope this helps.
Yes, but why? And, there is no entire value of PI - it's an irrational number. The approximation of PI provided by javascript is accurate enough for just about any computational purpose. For example, FF 2 gives:
3.141592653589793
for:
How much more precise than that do you need?Code:<script type="text/javascript">
document.write(Math.PI);
</script>
And remember, whatever you do to get a more accurate value will in almost all likelihood slow down the execution of your overall code.
I know it is an irrational number! PI is endless! I was wondering if the length of it could be extended with Math.abs(). I am guessing not.
-magicyte
Not like that. Math.PI will be what it will be. Math.abs(Math.PI) would be exactly the same value. What thetestingsite suggested might work though. However, as I said, once you go beyond the native Math.PI for whatever reason, your code will take a performance hit.
It's impossible to really calculate pi. It's a ratio of a perfect circle, which cannot really be created; and in order to create that perfect circle, the only real way to do it is with pi.
Thus, the only way to really calculate it is to do an average, working with both values somehow systematically to work toward the value.
There is an integral which I believe is impossible to solve, which holds the exact value of pi. I can't remember what it is-- I found this last year while bored in class.
Basically, if you were to integrate (solve, for those of you who haven't done any calculus) the integral, it would be pi, but it's not possible to do it.
I love this (courtesy of Wikipedia, if they allow the hot link):
http://upload.wikimedia.org/wikipedi...rolled-720.gif
It makes it seem so simple.
I like that. I never really quite understood the concept of pi until now. Thanks John. :)
Thank you all, jscheuer1, djr33, and thetestingsite.
-magicyte (did you ever know it is pronounced majisite?)
there have been numerous calculations to find out the exact value of pie, however research has never been able to get the full value. There was extensive research and i believe at one point a group of super computers computed it out to something like 100,000 places... dont quote me because I do not know the exact figure, but no one has ever been able to figure out the exact value.... The longest value I have ever seen used besides the TT symbol is 9 places 3.141592653
and that was once. Typically you only see 2 maybe 3 places being used as the "value" if written out in decimal form