Make your own free website on Tripod.com

Computing Pi with C

Here's the code:

/<><><><><><><><><><><><><><><><><><><><><><><>/

/<> Compute Pi to arbitrary precision <><><><>/

/<> uses Machin's formula... <><><><><><><><>/

/<> pi/4 = 4 arctan (1/5) - arctan (1/239)<>/

/<> Calculates Pi to 10 decimal places <><>/

/<><><><><><><><><><><><><><><><><><><><><>/

#include <stdio.h>

#define BASE 10000

int nblock;

int *tot;

int *t1;

int *t2;

int *t3;

main(argc, argv)

int argc;

char **argv;

{

arctan(result, w1, w2, denom, onestep)

int *result, *w1, *w2, denom, onestep;

{

}

copy(result, from)

int *result, *from;

{

}

zero(result)

int *result;

{

}

add(result, increm)

int *result, *increm;

{

}

sub(result, decrem)

int *result, *decrem;

{

}

mult(result, factor)

int *result, factor;

{

}

div(result, denom)

int *result, denom;

{

}

set(result, rhs)

int *result, rhs;

{

}

print(result)

int *result;

{

}

/<><><><><><><><><>/

/<> End of Prog<><>/

/<><><><><><><><></

/Pi= 3.1415926535

|Main||History of Pi||Formulas||Programs||Authors||References|