Pádraig Brady wrote:
Also arithmetic right shift is not useful.

While SAR (shift arithmetic right) is technically redundant with IDIV (integer divide), it's important in C programming where it is often used as an optimized special case of the latter. While this may not be especially important in shells, I'd be willing to argue that there is value in doing the same operation that C programmers expect.

Well that means the result is compiler dependent.
So scripts could give different results on another
platform, or less often within a platform.

Isn't the behavior of the C >> operator well-defined on signed integer types by the C standard? I would have expected that it is, and I would expect that defined behavior to be SAR, for the previously-mentioned reason.

I would reiterate Chet's suggestion that you ask the Austin Group for clarification if you wish to continue this discussion.

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
When on POSIX, do as POSIX mandates.



Reply via email to