Help stabilising mini-gmp

Vincent Lefevre vincent at vinc17.net
Thu Dec 1 17:15:24 UTC 2016


On 2016-12-01 08:57:12 -0700, Nelson H. F. Beebe wrote:
> Notice that it does NOT prohibit left-shifting negative values: it
> just says that behavior with negative SHIFT COUNTS is undefined.
> 
> The reason for that is that low-level expressions in C have always
> been intended, and assumed, to have straightforward mappings into
> hardware instructions.  The meaning of a negative shift has always
> been dependent on the machine's instruction set.

Is this true even when the shifted value is zero? For some time,
I've wondered why this was also undefined for zero (in MPFR, we
had code where the shift count could be out of range only for
the value 0).

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-devel mailing list