Two different expression result in c# and excel

c#, excel

Solution

They're both right, because `^` means different things in different contexts.

In C# it's the bitwise XOR operator.

In Excel it's the "power" operator used to raise one number to the power of another (xy).

Problem

I find something really weird, if I used below expression in excel and c# I get different results. ``` (1) ^ (-12) ``` Excel gives 1 and c# gives -11. Which one is right one?

Original source