On Monday, 11 August 2014 at 00:15:58 UTC, Timon Gehr wrote:
Note that for signed types, the two are not the same.
i/8 rounds towards 0, while i>>3 rounds towards min:

static assert(-1/8==0);
static assert(-1>>3==-1);

So many times i've found i hate signed types, especially when working with bit manipulation or encryption or something, so i'd usually use unsigned types.

Reply via email to