What does this mean in C# =-?

I am confuse in what is the function of that in C#: =- ??

Can please someone help me and explain to me what it does in C#?

Thanks in advance
I'm pretty sure =- is not a C# operator. It's just doing = then -

 
foo = -foo;  // negate a number 
closed account (Dy7SLyTq)
please dont double post
can you explain to me a bit more in detail what does it mean to negate a number? let's say foo = 4 ; what would foo = -foo, now mean?
closed account (Dy7SLyTq)
it means that its the opposite of what it is
so

lets say a = 4
foo = -a //foo = -4
a = -a //a = -4
foo = -a // foo = 4
1
2
3
4
5
6
7
int foo = 4;

// foo is 4  (positive 4)

foo = -foo;

// foo is -4  (negative 4) 
Thank you DTScode and Disch for taking the time to answer this question. Thank you for the support. I understand it now
Topic archived. No new replies allowed.