26.05.2011, 01:34
How can i make a function that returns the absolute value of a number?
Use it as a float and round it into an integer. |
printf("%d", floatround(floatabs(-47.00)));
// Will print 47.
stock abs(int)
{
if (int < 0)
return -int;
else
return int;
}