nickthedude nickthedude - 6 months ago 38
Objective-C Question

isn't there an operator in c to change the sign of a int float etc from negative to positive or vice versa?

trying to find absolute value and i thought there was a simple way to just invert the sign with '~' or something.

float newValue = oldValue * -1;


float newValue = -(oldValue); //() aren't needed, I just use them out of habit