title: With c++ integers, does 1 divided by 2 reliably equal 0, and 3/2 = 1, 5/2 = 2 etc.?
body: <p>There are two vectors of differing, yet related sizes. The larger is <code>(2 * RESOLUTION) + INDEX_OFFSET</code> (e.g. 2050) and the smaller is simply <code>RESOLUTION</code> (e.g. 1024). I believe it safe enough to assume that <code>uint16_t</code> can be used to contain the vector index.</p>
  
  <p>Iteration through the larger vector is performed by incrementing <code>resultIndex</code> by 2. During each iteration, an assignment is made to the smaller vector at the index <code>(resultIndex - INDEX_OFFSET) / 2</code>.</p>
  
  <p>Essentially, the code relies on the assumption that, whether <code>INDEX_OFFSET</code> is odd or even, the above division by 2 will always round down, regardless of architecture. For example, if <code>resultIndex</code> is 0 or 1, then 0 is expected, if is it 2 or 3 then 1 is expected, and so on. Is this a safe assumption, within the parameters above?</p>
  
  <p>N.B. I acknowledge the existence of <a href="https://stackoverflow.com/questions/8064447/dividing-integer-types-are-results-predictable" title="Dividing integer types - Are results predictable?">'Dividing integer types - Are results predictable?'</a> but it does not seem to be an exact match.</p>