Welcome to Dream.In.Code
Become a Java Expert!

Join 150,356 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,924 people online right now. Registration is fast and FREE... Join Now!




Approximating the value of pi

 
Reply to this topicStart new topic

Approximating the value of pi, in terms of Java

shadow_666
26 Jan, 2008 - 11:19 PM
Post #1

New D.I.C Head
*

Joined: 26 Jan, 2008
Posts: 4

I will like some help translating this into Java
Approximate the values of pi using this series

pi = 4(1-1/3 + 1/5-1/7 + 1/9-1/11 + 1/13-.........- 1/(2i-1) + 1/(2i+1) )

How can I put this series in terms of Java???

my program needs to approximate the value of pi at "i" times

User is offlineProfile CardPM
+Quote Post

GWatt
RE: Approximating The Value Of Pi
27 Jan, 2008 - 06:02 AM
Post #2

human inside
Group Icon

Joined: 1 Dec, 2005
Posts: 2,360



Thanked: 31 times
Dream Kudos: 500
My Contributions
We have this policy where you show the code you already have and ask for help with a specific problem. We don't write school projects for you.
User is online!Profile CardPM
+Quote Post

1lacca
RE: Approximating The Value Of Pi
27 Jan, 2008 - 07:42 AM
Post #3

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 12 times
My Contributions
The operator of multiplication is *
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Approximating The Value Of Pi
27 Jan, 2008 - 11:12 AM
Post #4

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,660



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Google is your friend. Here is a great website that will show you source code and examples...

PI Average through Java

Enjoy! smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 12:43PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month