title: What's the difference between "int" and "int_fast16_t"?
body: <p>As I understand it, the C specification says that type <code>int</code> is supposed to be the most efficient type on target platform that contains at least 16 bits.</p>
  <p>Isn't that exactly what the C99 definition of <code>int_fast16_t</code> is too?</p>
  <p>Maybe they put it in there just for consistency, since the other <code>int_fastXX_t</code> are needed?</p>
  <p><strong>Update</strong></p>
  <p>To summarize discussion below:</p>
  <ul>
  <li>My question was wrong in many ways. The C standard does not specify bitness for <strong>int</strong>. It gives a range [-32767,32767] that it must contain.</li>
  <li>I realize at first most people would say, &quot;but that range implies at least 16-bits!&quot; But C doesn't require two's-compliment storage of integers. If they had said &quot;16-bit&quot;, there may be some platforms that have 1-bit parity, 1-bit sign, and 14-bit magnitude that would still being &quot;meeting the standard&quot;, but not satisfy that range.</li>
  <li>The standard does not say anything about <strong>int</strong> being the most efficient type. Aside from size requirements above, <strong>int</strong> can be decided by the compiler developer based on whatever criteria they deem most important. (speed, size, backward compatibility, etc)</li>
  <li>On the other hand, <strong>int_fast16_t</strong> is like providing a hint to the compiler that it should use a type that is optimum for performance, possibly at the expense of any other tradeoff.</li>
  <li>Likewise, <strong>int_least16_t</strong> would tell the compiler to use the smallest type that's &gt;= 16-bits, even if it would be slower. Good for preserving space in large arrays and stuff.</li>
  </ul>
  <p><strong>Example:</strong> MSVC on x86-64 has a 32-bit <strong>int</strong>, even on 64-bit systems. MS chose to do this because too many people assumed <strong>int</strong> would always be exactly 32-bits, and so a lot of ABIs would break. However, it's possible that <strong>int_fast32_t</strong> would be a 64-bit number if 64-bit values were faster on x86-64. (Which I don't think is actually the case, but it just demonstrates the point)</p>