title: Double and Float format displaying different results
body: <p>I thought that the difference between double and float were the precision of the decimals. However, I am getting strange results with using double and float and they are no where close to one another.</p>
  
  <p>The first segment of code is used with the float format producing the correct results:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define ABSOLUTE_VALUE(number)      ( ((number) &lt; 0) ? -(number) : (number) )
  
  int main (void)
  {
      float number, absNumber;
  
  
      printf ("What number do you want to check the absolute value for? : ");
      scanf  ("%f", &amp;number);
  
      absNumber = ABSOLUTE_VALUE(number);
  
      printf ("The absolute value of %.2f is %.2f\n", number, absNumber);
  
      return 0;
  }
  </code></pre>
  
  <p>Output: <br />
  What number do you want to check the absolute value for? : -3 <br />
  The absolute value of -3.00 is 3.00</p>
  
  <p>The second segment of code is used with the double format producing incorrect results:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define ABSOLUTE_VALUE(number)      ( ((number) &lt; 0) ? -(number) : (number) )
  
  int main (void)
  {
      double number, absNumber;
  
  
      printf ("What number do you want to check the absolute value for? : ");
      scanf  ("%d", &amp;number);
  
      absNumber = ABSOLUTE_VALUE(number);
  
      printf ("The absolute value of %.2d is %.2d\n", number, absNumber);
  
      return 0;
  }
  </code></pre>
  
  <p>Output: <br />
  What number do you want to check the absolute value for? : -3 <br />
  The absolute value of -03 is 2147344384</p>