Listing 3 REAL_L3.C — demonstrates the effects of different precision. This code uses the native type double long for speed.

/* REAL_L3.C */

#include <math.h>
#include <real_t.h>

void main( void )
   {

   int i;
   real_t x, error;

   x = RC( 1.0 );
   error = RC( 0.0 );
   for ( i = 0; i < 30000; i++ )
      {
      error += fabs( x - sqrt( x ) * sqrt( x ) );
      x++;
      }
   error = error;

   }  /* function main */

/* End of File */