Change the sign of an integer

J

Jay B. Harlow [MVP - Outlook]

Totto,
In addition to multiple by -1 as Tom showed, you can subtract from 0.

Dim value As Integer = 0 - Math.Abs(MyInt)

I'm sure there are one or two other methods you could use.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top