It’s correct since -0 = 0, but I think it’s a cosmetic bug. When one does Gauss Elimination on a matrix of doubles, the output matrix has a number of these funny zeroes.
A work-around is to use:
y = y + 0;
y = -y also works, but you don’t know when to use it, since I can’t find a way of detecting it short of using cout.