Listing 2 REAL_L2.C demonstrate the effects of different precision. This program emphasizes simple operations and assignments.
/* REAL_L2.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 - RC( 0.1 ) * x * RC( 10.0 ) ); x++; } error = error; } /* function main */ /* End of File */