# Solaris17's PI project.



## Solaris17 (Jun 7, 2008)

Hey guys i wanted to make a pi program in C++ that didnt have a limit so i can publish it on tpu i wanted to make it so people didnt have a 32m digit limit i thought it would be kinda fun i have a really rough alpha and i was wondering if anyone could help me id obviously give credit were its due..its just that my C++ skills are a tad more than lacking and compiling it to an .exe is impossible as i cant figure out how to even do that..so if anyone wants me to shoot them the code that would be a great help thanks much!


----------



## Oliver_FF (Jun 8, 2008)

Yeah sure, I'll help you out - as long as you know how to compute Pi to XXX decimal places, that is


----------



## Deleted member 3 (Jun 8, 2008)

No offense Solaris, but you keep trying to overdo everything. If you don't even know how to compile your code you should start there. Play around, learn how the basics work. Once you actually know what you're doing think about publishing something.


----------



## DaedalusHelios (Jun 8, 2008)

Are you certified Solaris?


----------



## Oliver_FF (Jun 8, 2008)

One of my old friends, total genius (got 100% on TWO as-level physics papers ) tried something like this, it turns out it's a little harder than you first think...

Mainly because you need to create your own data structures to hold so many digits - and then you need to write functions to perform maths operations on your structures... Programming long division is dire, believe me haha


----------



## Solaris17 (Jun 8, 2008)

DanTheBanjoman said:


> No offense Solaris, but you keep trying to overdo everything. If you don't even know how to compile your code you should start there. Play around, learn how the basics work. Once you actually know what you're doing think about publishing something.



ya i guess your right dan i should probably work on it more.......well i guess ill do that then once i understand how things work a little bit better ill let you guys know!!!!

thank though oliver.


----------



## Disparia (Jun 8, 2008)

```
bcscale(10000);

$pi = $n = 4;
for ($d = 3; $d <= 5000; $d+= 2) {
	$pi = bcadd($pi, bcdiv(($n=$n*-1), $d));
}

echo '<pre>',chunk_split($pi),'</pre>';
```

Euler's is easy, though not terribly accurate. Took 5000 iterations to get a couple good digits 


```
3.14119265360579323526264494487808464626650513117799509139232716327663420688
4740267244039722655469412735889598932352008365373760263570818925607541994079
6721882831034784671840110273983943534903577555995445382042580984985109816...
```

Much better ways are the algorithms from Ramanujan and Chudnovsky. Started to write one out as a coding exercise for myself, didn't finish though. Not that I'm suggesting that my code would rival the already existing PI calc programs, just something to play around with.


----------



## Oliver_FF (Jun 8, 2008)

You could use:

Pi = 4 * (arctan(1/2) + arctan(1/3))

to get a perfect answer, but arctan would be horrific to program


----------



## Kreij (Jun 8, 2008)

Solaris, 
You may seriously want to try Microsoft's tools.
To compile to a .exe all you have to do is click a button.


----------



## Solaris17 (Jun 8, 2008)

ok thanks guys ill give it a go thanks for the support and thanks dan for the wise advice  ill let everyone know.


----------

