%{} if ( (1.0E+8*x**2) == 1.0 ) then print*, 'Correct' end ifshould print

%{} epsilon = 1.0E-7 w = 1.0E+8 * x**2 if ( abs(w-1.0) .LE. 0.5*epsilon*( abs(w)+abs(1.0) ) ) then print*, 'Correct' end ifThis time we allow small roundoff's to appear, and the program takes the right branch.

In the following example the branch correct is taken:

%{} program quiz_2b implicit none real :: x x = 1.0/2.0 if ( (2.0*x) .eq. 1.0 ) then print*, 'Correct' else print*, 'Funny' end if end program quiz_2bwhile in the next the branch incorrect is taken:

%{} program quiz_2a implicit none real :: x x = 1.0/3.0 if ( (3.0*x) .eq. 1.0 ) then print*, 'Correct' else print*, 'Funny' end if end program quiz_2a

Adrian Sandu 2001-08-26