2. 10. 2014 17:11
Snad jsem neudělal ve spěchu chybu:
unsigned efficient_adc_by_ponkrac (unsigned a, unsigned b, bool * carry_ptr) { unsigned const c = a + b + (unsigned)*carry_ptr; *carry_ptr = (int)(a | b) > 0 && (int)c <= 0; return c; };