pi

Blitz3D Forums/Blitz3D Beginners Area/pi

I think what is required here is an iterative process to calculate Pi... to more than the accuracy of the built-in value. I doubt that BB is the best language to try this in though, as you would need to define your own number types to get around the limited accuracy of floats or the max/min values for long ints. [e.g. by the time you are calculating small differences of 0.0000000000000001, you are probably stressing the accuracy of internally stored values.]

This kind of problem would normally be tried in a language like FORTRAN that has more scope for defining the precision of variables.

I do remember seeing a BBC Basic program to do this many years ago... I will do a quick search to see what I can find...

Good options might be...

The Monte Carlo method (similar to Count Bouffon's if memory serves me right !) would make a good 'visual' calcualtion of Pi as you show which 'darts' thrown at a circle in a square are 'hits' or 'misses'
http://www.ticalc.org/archives/news/articles/2/28/28666.html

and some others including the Gregory series as downloadable VB code...
http://www.vb-helper.com/howto_calculate_pi_series.html