* Simon Plouffe <simon.plouffe@gmail.com> [Jul 21. 2007 09:17]:
yes, but your program does not add full precision number isn't ?
For which definition of full precision? I use 64-bit floats, anything further needs a arbitrary precsion library.
I modified your loop the following way.
int main() { double i, s; unsigned long k; i = 0.0; s = 0.0; for (k=0; k<50000000; ++k) { i+=1.0; s+=1.0/i; } printf("%f %f\n", i, s); }
with the same compile : i.e : gcc -W -Wall -O2 boucle.c -o boucle
boucle.c being the program name
When ran it gives this result : 50000000.000000 18.304749
one second later
This timing measures the speed of the FPU division instruction.
simon plouffe
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun