query: nearest integer divide

Carl Devore devore@math.udel.edu
Mon, 24 Mar 2003 07:07:28 -0500 (EST)


On Mon, 24 Mar 2003, Jason Moxham wrote:
> On computing short products , Thom Mulders , Technical Report No 276
> Department of Computer Science ETH Zurich , Nov 1997
> www.inf.ethz.ch/research/publications/data/tech-reports/2xx/276.ps

This, and the previous ideas in this thread, seem unnecessarily
complicated to me.  We want to divide x by 2^p and round the
result to the nearest integer.  Can't we just do this: truncate p bits
from x.  If the last bit truncated was a 1, then add 1 to the result (or
subtract 1 if it was negative).

Isn't this easy?  Am I missing something?