-1 * int.MinValue == int.MinValue?? Is this a bug?

Viewed 4399

In C# I see that

-1 * int.MinValue == int.MinValue

Is this a bug? It really screwed me up when I was trying to implement a search tree. I ended up using (int.MinValue + 1) so that I could properly negate it.

5 Answers
Related