Am I going mad? I have the following code:
Debug.Print("10 ^ 0 = " + (10 ^ 0));
which I expect to print out “10 ^ 0 = 1” but instead it prints out “10 ^ 0 = 10”
Why?
Am I going mad? I have the following code:
Debug.Print("10 ^ 0 = " + (10 ^ 0));
which I expect to print out “10 ^ 0 = 1” but instead it prints out “10 ^ 0 = 10”
Why?
Ah, Is there an exponent operator in C#? - Stack Overflow, shows how rarely I raise something to a power. It’s
System.Math.Pow(10, 0)
^ is the exclusive OR operator…
Nbuch once gave me a nice tip for times like this… Just claim there was alcehol involved.
Sadly not enough alcohol, lack of sleep though ;-(