In C++, it's always sufficient to use
std::abs; it's overloaded for all the numerical types.
abs only works on integers, and you need
fabs for floating point values. These are available in C++ (along with all of the C library), but there's no need to use them.