round partial sum to avoid floating point errors