I thought that ^ did that.
I expected:
10^0=1
10^1=10
10^2=100
What I’m getting
10^0=10
10^1=11
10^2=8
the actual code is
int value = 10 ^ exp;
replacing exp for 0, 1, and 2
What does the ^ operator do?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Math.Pow(x, y) to get x raised to the power of y. You were doing an XOR. C# operators