Skip to main content
5 events
when toggle format what by license comment
Jan 9, 2013 at 10:27 vote accept Ohad Asor
Jan 9, 2013 at 10:27
Jan 9, 2013 at 8:56 comment added Ohad Asor Thanks for your help! Unfortunatly, this doesn't work as well. Here's my code: #include <iostream> #include <cmath> using namespace std; long double phi(long double x, long double n, long double t = 2) { static long double pi = acos((long double)-1); return sin((n+.5)*pix/t)*sqrt(t*2.)/(pi*(n+.5)); } int main(int, char*) { long double sum = 0, x=.8,y=.3; for (long double n = 1;n< 100000;n++) { sum += phi(x,n)*phi(y,n); if (((int)n)%1000) cout<<n<<' '<<sum<<endl; } return 0; }
Jan 9, 2013 at 1:46 history edited Branimir Ćaćić CC BY-SA 3.0
Typo correction.
Jan 9, 2013 at 1:21 history edited Branimir Ćaćić CC BY-SA 3.0
Corrections.
Jan 9, 2013 at 1:02 history answered Branimir Ćaćić CC BY-SA 3.0