I want to convert a positive value to a negative value, for example:
let a: Int = 10
turn it to -10, my current idea is just use it to multiple -1
-10
-1
a * -1
I'm not sure if this is proper, any idea?
Just use - operator.
-
let negativeA = -a