Files
bbp/bbp.c
Koree A. Smith dec4abf1fa Initial commit
2025-11-08 17:08:16 -06:00

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);
}