Main Site Documentation

10 ^ 0 =


#1

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?


#2

Ah, http://stackoverflow.com/a/3034607/575530, shows how rarely I raise something to a power. It’s


System.Math.Pow(10, 0)


#3

^ is the exclusive OR operator…


#4

Nbuch once gave me a nice tip for times like this… Just claim there was alcehol involved. :wink:


#5

Sadly not enough alcohol, lack of sleep though ;-(