On 11/21/2014 1:33 PM, Marco Leise wrote:
As someone using unsigned types all the time, all I need to
keep in mind are two rules:

1) Overflow:

   uint number;
   …
   number = 10 * number + ch - '0';

   It is handled with:
   if (number > uint.max / 10)
   if (number > uint.max - (ch - '0'))

You're better off with core.checkedint here, as not only is it correct, but (eventually) it will enable the compiler to optimize it to simply checking the carry flag.

Reply via email to