In PSET4 Edges Filter problem you are supposed to calculate
Gx ^ 2. But the operator
^ in C does not seem to mean raising in a power. For
Gx = -9 it returns
Gx ^ 2 = -11 and so on. Turned out
^ is XOR operator.
I ended up using
Gx * Gx but I wonder if there is a proper operator.
I'm also confused about the use of
^ 2 in the text of the problem on CS50. It was framed as a code sample, but ended up not working as one due to the ambiguity of
^ symbol. Is that a typo?