21 Jul
2007
21 Jul
'07
3:59 a.m.
yes, you are right, the computation of the inverse takes most of the time, then ok if I do : /*--------------------------------------*/ int main() { double i, s; unsigned long k; i = .0000817181878711; s = 0.0; for (k=0; k<999999999; ++k) { i+=1.0; s+=i; } printf("%f %f\n", i, s); if ( s < 100 ) return 1; return 0; } /*--------------------------------------*/ with the same compilation options, in a loop takes approx. 1.5 seconds for each iteration on a 2.13 Ghz pentium core2duo with 2 gigs of ram. which makes 666,666,666 additions per second, which makes that CPU 6667 times faster than the ENIAC, sounds fast enough for me! that's a decent speed. simon plouffe