Maybe you are accumulating into an uninitialized variable. as in dvariable x; // x is uninitialized x+=u; // trouble