signed vs unsigned
Thiago Macieira
thiago at macieira.org
Wed Mar 23 16:15:31 PDT 2016
On quarta-feira, 23 de março de 2016 09:53:04 PDT Robert Helling wrote:
> Anyway, my conclusion from all this trouble in the past was to _always_ use
> the signed version since this prevents the trouble. As far as I can see,
> the potential cost is that the maximally representable number is only half
> the size but this should not be a problem for us since we stay safely away
> from those limits.
That is the recommendation of the C++ committee too, the very one that uses
size_t for a lot of things. They recommend to always use signed integers,
except where you explicitly need well-behaved modulo-2 overflows.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
More information about the subsurface
mailing list