
13 Jul
2014
13 Jul
'14
4:13 p.m.
On Sun, Jul 13, 2014 at 12:42 PM, Henning Thielemann
What kind of data do you have in mind, where both signed and unsigned shifts make sense?
It almost always matters and is independent of the type. For instance, pretty much every one of these requires one or the other and it doesn't necessarily coorespond to the signedness of the arguments relying on C casts. https://graphics.stanford.edu/~seander/bithacks.html Generally, except for the very basic case of replacing a multiply with a shift, you will want one behavior or the other. Plus, it is exactly the distinction made in CPUs, they have independent arithmetic and logical shift operations. John -- John Meacham - http://notanumber.net/