Correctness bug in TDPL

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri May 13 06:32:11 PDT 2011


On 5/13/11 3:25 AM, Timon Gehr wrote:
> On p368 the CheckedInt struct does not check for overflow in the unary minus
> operator.

Unary minus never overflows. That being said, there is the oddity that 
-x is x when x == int.min. Even in that case there is no loss of 
information.

Andrei


More information about the Digitalmars-d mailing list