There are C functions from <math.h> that will do what you want:
abs(int val);
labs(long val);
llabs(long long val);
fabs(double val);
fabsf(float val);
fabsl(long double val):
Given that CGPoint structures are composed of CGFloats, you should use fabsf here.
Check out the Wikipedia page