title: Testing floating point numbers equality
body: <p>I am using gfortran in MinGW under Windows 7 (32bit) to compile Fortran code. Here is the minimal code contained in the file <code>testequal.f</code>:</p>
  
  <pre><code>      program testequal
        real*8 a1, a2
  
        a1 = 0.3d0
        a2 = 0.7d0
  
        write(*,*) 1.d0
        write(*,*) a1+a2
        write(*,*) a1+a2.eq.1.0
        write(*,*) a1+a2.eq.1.d0
        end
  </code></pre>
  
  <p>Compiled with</p>
  
  <pre><code>gfortran testequal.f -std=legacy
  </code></pre>
  
  <p>the output is:</p>
  
  <pre><code>1.0000000000000000
  1.0000000000000000
  F
  F
  </code></pre>
  
  <p>But I expect the two booleans to be both <code>T</code> (true). What is the problem here? </p>