I read that the ^
operator is the logical XOR operator in C#, but I also thought it was the "power of" operator. What is the explanation?
It is not the power of operator of C# since there is no such operator in C#. It is just the XOR operator.
For "power of", use Math.Pow.
As you can see from this page on the C# Operators, ^
is listed under the "Logical (boolean and bitwise)" category, which means it can both handle boolean values, and binary values (for bitwise XOR).