Nick Nick - 2 months ago 14
C# Question

Convert a positive number to negative in C#

You can convert a negative number to positive like this:

int myInt = System.Math.Abs(-5);


Is there an equivalent method to make a positive number negative?

Answer

How about

myInt = myInt * -1