Hello,
I have two values that I want to subtract from one another but I want them to always be unsigned.
Is there a way to to unsign a float if it is signed; other then creating an alogorithm?
Thanks
- Branden
Hello,
I have two values that I want to subtract from one another but I want them to always be unsigned.
Is there a way to to unsign a float if it is signed; other then creating an alogorithm?
Thanks
Mathf.Abs
Floats inherently have a bit that indicates negative or positive. So technically by definition they can’t be unsigned.
–Eric
Cool! Thank you guys, I didn’t know that…
So instead, I just created this algorithm…
float temp = angle;
if(temp < 0)
temp *= -1;
Kind regards,
Branden
or… angle=Mathf.Abs(angle);