On Fri, 3 Jan 2014, Torbjorn Granlund wrote:

Vincent Lefevre <vinc...@vinc17.net> 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
_______________________________________________
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to