Why is it that in all of the books I have on VB and C++ they say that the value of PI to five decimal places is 3.14159 when I work it out to be 3.14285, am I missing something.
Thanks in advance for any replies. AndyB.
Printable View
Why is it that in all of the books I have on VB and C++ they say that the value of PI to five decimal places is 3.14159 when I work it out to be 3.14285, am I missing something.
Thanks in advance for any replies. AndyB.
HeHe
You have a bigger piece of pi
Sorry, coulden't resist!
I think all you need is 3.14 for PI, all that other crap is just there to confuse you :rolleyes:.
The value of Pi is approximately:
This is an irrational and transcendental number.Code:Pi = ~3.1415926535897932384626433832795 - thanks Windows Calculator! :rolleyes:
However, you are probably using another approximation:
This is close, but not exact. As you can easily see this is a rational number.Code:Pi = 22/7 = 3.14285714285714285714285714285714.......
To get it in VB, you can do this:
Code:Dim Pi As Double
Pi = Atn(1) * 4
Here you go...Pi to a few thousnad figures.
I'm not sure anybody would want to build rocket guidance software in VB :rolleyes:Quote:
Originally posted by billfaceuk
Here you go...Pi to a few thousnad figures.
3.14 should be enough for those pretty circle thingies and if not, Atn(1) * 4 should be more than enough.
I know it to 10 decimal places off by heart..3.1415926535. I also know my bank's sort code and account number of my current account. I also know my mastercard number, it's expiry and I also know my debit card number and it's expiry!! guess I just like long numbers.
And before you ask, no I ain't ganna post them!!
I like the beginning of 'e'. :rolleyes:
Code:e = 2.718281828...
e = 2.7 18 28 18 28 ...