I have the line memset(C, 0, N*M);, where C is a matrix of doubles. (I am using WSL.)
However if I look in gdb, certain elements in the matrix are set to either -nan(0xffffffffffff8) and others are set to for example 9.0096750001652956e-314.
The first one doesn't give any errors but a += doesn't seem to change anything (or at the very least doesn't seem to make the nan thing disappear), while the second is an issue if the element is not changed or only has += 0, as the comparison if (0 == C[i][j]) then fails.
If I set the values to 0 manually, then these issues do not arise at all.
Is this a WSL thing, or is there something about memset that I do not understand?