title: How to correctly iterate over all long type range
body: <p>If I'd like to loop over all long's range, I would ingenually do:</p>
  
  <pre><code>for (long i = long.MinValue; i &lt;= long.MaxValue; ++i)
  {
      // Do something
  }
  </code></pre>
  
  <p>But it loops forever! </p>
  
  <p>For example, if I do:</p>
  
  <pre><code>for (byte b = byte.MinValue; b &lt;= byte.MaxValue; ++b)
  {
      // Do something
  }
  </code></pre>
  
  <p>It loops forever too, but I solved like this:</p>
  
  <pre><code>for (int i = byte.MinValue; i &lt;= byte.MaxValue; ++i)
  {
      byte b = Convert.ToByte(i);
  
      // Do something
  }
  </code></pre>
  
  <ol>
  <li>With <code>long</code> type how can I do?</li>
  <li>With <code>long</code> type how can I achieve the same if I don't increment by 1, but of an higher distance?</li>
  <li>Are those "ideas" to loop over a type range correct, are there some issues to be warned about, or can I do it better?</li>
  </ol>