main()
 { float up = 0.0, down = 0.0;  int i, N;
   N = 10 * 1000 * 1000;

   for( i=1; i <= N; i++ )
       up += 1.0 / i;

   for( i=N; i >= 1; i-- )
     down += 1.0 / i;

   printf("SUM 1/i\n1  up to  %i : %f\n%i down to 1 : %f\n",
          N, up, N, down);
 }
/* Beware of rounding error in floating point calculations */
/* particularly 32-bit floats.  Mathematically, it should  */
/* not matter if  SUM[1..N] 1/i  is done                   */
/* from 1 up to N, or v.v., but it does                    */
/*                                     */
/*   SUM 1/i                           */
/*   1  up to  10000000 : 15.403683    */
/*   10000000 down to 1 : 16.686031    */
/*                         ^           */
/* ----------------------------------- */
