pi_funs.h
/* 
    Begins by defining the first term in the sequence (sum = 1), then adding terms by
    adding 2 to the denominator of each term and alternating the sign of each term by
    multiplying it by -1 at each iteration.  Then, this next term is incorporated into
    the sum by (sum += (num/denom)). The return of this function is 4 times the result
    of the iteration.
	*/
Begins by defining the first term in the sequence (sum = 1), then adding terms by
adding 2 to the denominator of each term and alternating the sign of each term by
multiplying it by -1 at each iteration.  Then, this next term is incorporated into
the sum by (sum += (num/denom)). The return of this function is 4 times the result
of the iteration.
Begins by defining the first term in the sequence ( sum = 1 ) then adding terms by adding 2 to the denominator of each term and alternating the sign of each term by multiplying it by - 1 at each iteration . Then this next term is incorporated into the sum by ( sum + = ( num / denom )) . The return of this function is 4 times the result of the iteration .
double pi_leibniz (int n)
{
	double sum = 1, num = 1, denom = 1;
	int i;
	for(i = 0; i < (n-1); i++)
	{
		denom += 2;
		num *= -1;
		sum += (num/denom);
	}
	return (sum *= 4);
}
double pi_leibniz ( int n ) { double sum = 1 , num = 1 , denom = 1 ; int i ; for ( i = 0 ; i < ( n - 1 ) ; i ++ ) { denom += 2 ; num *= -1 ; sum += ( num / denom ) ; } return ( sum *= 4 ) ; }
Begins by defining the first term in the sequence (sum = 1), then adding terms by
adding 2 to the denominator of each term and alternating the sign of each term by
multiplying it by -1 at each iteration.
Begins by defining the first term in the sequence ( sum = 1 ) then adding terms by adding 2 to the denominator of each term and alternating the sign of each term by multiplying it by - 1 at each iteration .