21 Apr
2017
21 Apr
'17
7:38 p.m.
Depends rather on how fast your division and how large k --- eg. n/(1 + 2^-k) = n - n 2^-k + n 2^-2k - ... costs [63/k] logical shifts, ignoring final tweaking. WFL On 4/22/17, David Wilson <davidwwilson@comcast.net> wrote:
Given 64-bit unsigned integer n and 0 <= k <= 63, can floor(n/(1 + 2^-k)) be computed more quickly than by general integer division?
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun