16 lines
366 B
C
16 lines
366 B
C
#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);
|
|
}
|