28 Numerics library [numerics]

28.7 Mathematical functions for floating-point types [c.math]

28.7.2 Absolute values [c.math.abs]

[Note 1: 
The headers <cstdlib> and <cmath> declare the functions described in this subclause.
— end note]
constexpr int abs(int j); constexpr long int abs(long int j); constexpr long long int abs(long long int j);
Effects: These functions have the semantics specified in the C standard library for the functions abs, labs, and llabs, respectively.
Remarks: If abs is called with an argument of type X for which is_unsigned_v<X> is true and if X cannot be converted to int by integral promotion, the program is ill-formed.
[Note 2: 
Allowing arguments that can be promoted to int provides compatibility with C.
— end note]
constexpr floating-point-type abs(floating-point-type x);
Returns: The absolute value of x.
See also: ISO/IEC 9899:2018,,