Including <limits.h> in gmp-impl.h

Marc Glisse marc.glisse at
Fri Jan 3 11:19:26 UTC 2014

On Fri, 3 Jan 2014, Torbjorn Granlund wrote:

> Vincent Lefevre <vincent at> writes:
>  Note that if you want to care of non-two's-complement
>  implementations, you should write:

Isn't the notion of 2's complement restricted to signed types?

>  #define __GMP_USHRT_MAX  (0 + (unsigned short) -1)

The previous form has worked so far, and I'd like to remove the macro 
completely soon, so it doesn't seem worth it.

> Is that out-of-range conversion really Proper C?

unsigned = modular arithmetic, so yes, it is fine.

Marc Glisse

More information about the gmp-devel mailing list