Hello How can I convert a positive float to a negative float in C#?
Thanks, Andreas
Hello How can I convert a positive float to a negative float in C#?
Thanks, Andreas
x = -Mathf.Abs(x);
x = -x;
Do you remember this from school?
1*1=1
-1*-1=1
1*-1=-1
-1*1=-1
Mathf.Abs for absolute value also works on a variable.
x = 10;
print(-x);
prints: “-10”