How to use ABS in C++?

Hi Alexa.kl,

yes - abs() is good, it works with both integers and floating point numbers.
There is also fabs() which only works with floats - fabs() is slightly faster because of this.

1 Like