Initial commit
This commit is contained in:
15
bbp.c
Normal file
15
bbp.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
DoBBP(double n)
|
||||
{
|
||||
double digitvalue;
|
||||
double powerthing;
|
||||
|
||||
powerthing = pow(1/16, n);
|
||||
printf("powerthing: %f\n", powerthing);
|
||||
digitvalue = ((4 / (8 * n + 1)) - (2 / (8 * n + 4)) - (1 / (8 * n + 5)) - (1 / (8 * n + 6)) * powerthing);
|
||||
|
||||
printf("Digit of Pi: %f\n", digitvalue);
|
||||
}
|
||||
Reference in New Issue
Block a user