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
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.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
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.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
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.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
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.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
I love this (courtesy of Wikipedia, if they allow the hot link):
It makes it seem so simple.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
I like that. I never really quite understood the concept of pi until now. Thanks John.![]()
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
Thank you all, jscheuer1, djr33, and thetestingsite.
-magicyte (did you ever know it is pronounced majisite?)
Last edited by magicyte; 07-07-2008 at 05:23 PM. Reason: forgot something
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
Bookmarks