Sorry if you got the wrong impression. I meant that all you guys here seem like you're really hard core and everything is easy to you, and calculating pi with BPP seems like it would be a popular...
Type: Posts; User: eehiram
Sorry if you got the wrong impression. I meant that all you guys here seem like you're really hard core and everything is easy to you, and calculating pi with BPP seems like it would be a popular...
Yes, completely wrong--I don't even get the initial 3. Yes, pi can be written out in hexadecimal digits. I expected everyone here to be familiar with BPP's formula for the nth digit of pi, as it is...
This code from the Internet works, but I did not write it:
#include <stdio.h>
int a[52514], b, c=52514, d, e, f=1e4, g, h;
main(){
for(;b=c-=14;h=printf("%04d",e+d/f))
...
I am attempting to use the Bailey-Borwein-Plouffe algorithm, ((4/(8n+1))-(2/(8n+4))-(1/(8n+5))-(1/(8n+6)))/16^n for the nth digit of pi.
Here is my code:
#include <stdio.h>
int main(void){
...
I think the 16 bit int vs. 32 bit int seems to explain the discrepancy. For now, I don't have the money to put up for a new c compiler, or even a 2002 c compiler for that matter. So, I throw in the...
Here is one website with the above code: http://www.matpack.de/Info/Mathematics/Pi.html
Well, Salem, the code still does work. Here is my version, copied and pasted:
int main(void){
int a[3302],b=3301,*c=a,d,e,f=0;
for(e=b; --e; *c++=1)
;
*c=2;
for(d=2001; d--;...
Well, cwr, I'm not sure what the problem is because I copied and pasted my code into this forum in my original post, so it's not the code itself. Maybe it's a glitch in my compiler.
The only remaining error states that printf "function declared implicit int". I tried adapting your (int) suggestion, but it doesn't seem to have the right effect on my compiler.
The first line of output reads: 166650389113343-1859-4810-044205378-071015423-14763-505304262005271204801135-150
What's the O(n^2) formula?
Thanks for the pointers, Jafet. The point of this...
Hello, everyone. I am trying to use a c program I found on the Internet:
int main(void){
int a[3302],b=3301,*c=a,d,e,f;
for(e=b; --e; *c++=1)
;
*c=2;
for(d=2001; d--;...