title: Comparing doubles
body: <p>I'm writing a program that consists of a while loop that reads two doubles and prints them. The program also prints what the larger number is and what the smaller number is.</p>
  
  <p>this is the code i have so far.</p>
  
  <pre><code>int main()
  {
  
                                      // VARIABLE DECLARATIONS 
  
      double a;
      double b;
  
      while (a,b != '|')              //WHILE A &amp; B DO NOT EQUAL '|'
      {
          cin &gt;&gt;a &gt;&gt;b;
          cout &lt;&lt; a &lt;&lt; b &lt;&lt; "\n" ;
  
  
          if (a&lt;b)                    //IF A&lt;B: SMALLER VALUE IS A
          cout &lt;&lt; "The smaller value is:" &lt;&lt; a &lt;&lt; endl 
               &lt;&lt; "The larger value is:" &lt;&lt; b &lt;&lt; endl ;
  
          else if (b&lt;a)               //ELSE IF B&lt;A 
              cout &lt;&lt; "The smaller value is:" &lt;&lt; b &lt;&lt; endl 
                   &lt;&lt; "The larger value is:" &lt;&lt; a &lt;&lt; endl ;
          else if (b==a)
              cout &lt;&lt; "The two numbers you entered are equal." &lt;&lt; "\n" ;
  
      }
  }
  </code></pre>
  
  <p>The next step is having the program write out "the numbers are almost equal" if the two numbers differ by less than 1.0/10000000. How would I do this?</p>