How would you change the sign of a negative number to a positive number?
Like, change -.6 to .6 or -.2 to 2
How would you change the sign of a negative number to a positive number?
Like, change -.6 to .6 or -.2 to 2
Thank You.
Positive values will remain positive. If your goal is to switch the sign, multiply by -1. Positive becomes negative, negative becomes positive.
Good point. Abs in this case was the answer.
A shortcut for
d = d * -1
is
d = -d
And just for the curious, a longer d = ABS(d) alternative is
If d < 0 Then d = -d
Makes sense and perfectly clear.