Issue #17740: add std:: namespace to calls to abs()
Follow up to 03750623 where removing 'using namespace std' caused existing calls to abs() to use the one in the global namespace, which is not templated.
In reviewing all calls in abs() in this file, also:
- changed an fabs to std::abs
- changes some defines to actual const variables
- include cmath