#include #include /* Numerical integration of the integral from 1 to 2 */ /* of the function 1/x: the exact value is ln 2 */ /* Integration ??? */ /* with various choices of the discretization step h */ int main() { float xnp1, xn, tn, h, ln2; int nb_steps, i; ln2 = log(2.0); /* exact value */ nb_steps = 1; while (nb_steps <= 1073741824) { h = 1.0 / (double)(nb_steps); tn=1.0; xn=0.0; for (i=0; i