#
[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 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:2024, 7.12.8.3, 7.24.7.1

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant