Tony Mountifield wrote: > This should be: res = (int)*input + value; > > Without the cast, I believe the compiler is at liberty to evaluate the RHS > in short precision (which might still overflow) and only extend on assigning > the result to res. Absolutely correct. Will fix in a jiffy.