std::decimal(3)

๐Ÿ“ฆ
version 16.2.1+r23+gd564253eb6c8 ยท 5 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44

โœจ std::decimal โœจ

ok so bestie, welcome to std::decimal from the Library Functions Manual ๐Ÿ’… this is the page for ISO/IEC TR 24733 Decimal floating-point arithmetic and honestly? it's giving "niche but iconic" ๐ŸŽ€


๐ŸŒธ NAME ๐ŸŒธ

std::decimal โ€” literally the whole vibe of ISO/IEC TR 24733 Decimal floating-point arithmetic ๐Ÿ’–


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

๐Ÿ‘‘ Classes

  • class decimal128 โ€” 3.2.4 Class decimal128. โœจ
  • class decimal32 โ€” 3.2.2 Class decimal32. ๐Ÿ’œ
  • class decimal64 โ€” 3.2.3 Class decimal64. ๐ŸŒˆ
no cap, that's the whole lineup: three decimal classes, all cute, all numbered, all waiting for you to read the next part ๐Ÿซถ

๐Ÿงฎ FUNCTIONS ๐Ÿงฎ

Okay bestie, sit down, hydrate, because this is the part where the manpage just dumps every single overloaded function on you at once. ๐Ÿ’€ It's giving "meet my 300 cousins, all at the same family reunion, and yes you have to hug every one of them." But it's fine!! They're literally all variations on the same three types โ€” decimal32, decimal64, decimal128 โ€” plus the plain old C++ integer types. Once you clock the pattern, you'll be reading this like a group chat you're 400 messages behind on. ๐Ÿซถ


the converters ๐Ÿ”„

These ones take a decimal and hand you back a normal-ish number. Their whole personality is "translate for me please." โœจ

double decimal128_to_double (decimal128 __d)
float decimal128_to_float (decimal128 __d)
long double decimal128_to_long_double (decimal128 __d)
long long decimal128_to_long_long (decimal128 __d)
double decimal32_to_double (decimal32 __d)
float decimal32_to_float (decimal32 __d)
long double decimal32_to_long_double (decimal32 __d)
long long decimal32_to_long_long (decimal32 __d)
double decimal64_to_double (decimal64 __d)
float decimal64_to_float (decimal64 __d)
long double decimal64_to_long_double (decimal64 __d)
long long decimal64_to_long_long (decimal64 __d)
Heads up bestie: decimal32_to_long_long is a Non-conforming extension: Conversion to integral type. So it's the one cousin who showed up uninvited to the standard. ๐Ÿซฃ

And then the โœจgeneric-nameโœจ versions, which take any of the three decimal flavors and spit out one specific type โ€” same energy, different wig:

double decimal_to_double (decimal128 __d)
double decimal_to_double (decimal32 __d)
double decimal_to_double (decimal64 __d)
float decimal_to_float (decimal128 __d)
float decimal_to_float (decimal32 __d)
float decimal_to_float (decimal64 __d)
long double decimal_to_long_double (decimal128 __d)
long double decimal_to_long_double (decimal32 __d)
long double decimal_to_long_double (decimal64 __d)
long long decimal_to_long_long (decimal128 __d)
long long decimal_to_long_long (decimal32 __d)
long long decimal_to_long_long (decimal64 __d)

the makers ๐Ÿ—๏ธ

Need to build a decimal out of a coefficient and an exponent? Say less. You get a static factory for each type, and each one comes in a long long flavor and an unsigned long long flavor, because options are self-care. ๐Ÿ’…

static decimal128 make_decimal128 (long long __coeff, int __exp)
static decimal128 make_decimal128 (unsigned long long __coeff, int __exp)
static decimal32 make_decimal32 (long long __coeff, int __exp)
static decimal32 make_decimal32 (unsigned long long __coeff, int __exp)
static decimal64 make_decimal64 (long long __coeff, int __exp)
static decimal64 make_decimal64 (unsigned long long __coeff, int __exp)

operator!= โ€” the "we are NOT the same" collection ๐Ÿ’…

This is the biggest flex in the whole page. Every single cross-type combo of "are these two things not equal" that you could possibly want. All 45 of them. Yes, forty-five. Not me counting them for you. ๐Ÿ˜ญ

bool operator!= (decimal128 __lhs, decimal128 __rhs)
bool operator!= (decimal128 __lhs, decimal32 __rhs)
bool operator!= (decimal128 __lhs, decimal64 __rhs)
bool operator!= (decimal128 __lhs, int __rhs)
bool operator!= (decimal128 __lhs, long __rhs)
bool operator!= (decimal128 __lhs, long long __rhs)
bool operator!= (decimal128 __lhs, unsigned int __rhs)
bool operator!= (decimal128 __lhs, unsigned long __rhs)
bool operator!= (decimal128 __lhs, unsigned long long __rhs)
bool operator!= (decimal32 __lhs, decimal128 __rhs)
bool operator!= (decimal32 __lhs, decimal32 __rhs)
bool operator!= (decimal32 __lhs, decimal64 __rhs)
bool operator!= (decimal32 __lhs, int __rhs)
bool operator!= (decimal32 __lhs, long __rhs)
bool operator!= (decimal32 __lhs, long long __rhs)
bool operator!= (decimal32 __lhs, unsigned int __rhs)
bool operator!= (decimal32 __lhs, unsigned long __rhs)
bool operator!= (decimal32 __lhs, unsigned long long __rhs)
bool operator!= (decimal64 __lhs, decimal128 __rhs)
bool operator!= (decimal64 __lhs, decimal32 __rhs)
bool operator!= (decimal64 __lhs, decimal64 __rhs)
bool operator!= (decimal64 __lhs, int __rhs)
bool operator!= (decimal64 __lhs, long __rhs)
bool operator!= (decimal64 __lhs, long long __rhs)
bool operator!= (decimal64 __lhs, unsigned int __rhs)
bool operator!= (decimal64 __lhs, unsigned long __rhs)
bool operator!= (decimal64 __lhs, unsigned long long __rhs)
bool operator!= (int __lhs, decimal128 __rhs)
bool operator!= (int __lhs, decimal32 __rhs)
bool operator!= (int __lhs, decimal64 __rhs)
bool operator!= (long __lhs, decimal128 __rhs)
bool operator!= (long __lhs, decimal32 __rhs)
bool operator!= (long __lhs, decimal64 __rhs)
bool operator!= (long long __lhs, decimal128 __rhs)
bool operator!= (long long __lhs, decimal32 __rhs)
bool operator!= (long long __lhs, decimal64 __rhs)
bool operator!= (unsigned int __lhs, decimal128 __rhs)
bool operator!= (unsigned int __lhs, decimal32 __rhs)
bool operator!= (unsigned int __lhs, decimal64 __rhs)
bool operator!= (unsigned long __lhs, decimal128 __rhs)
bool operator!= (unsigned long __lhs, decimal32 __rhs)
bool operator!= (unsigned long __lhs, decimal64 __rhs)
bool operator!= (unsigned long long __lhs, decimal128 __rhs)
bool operator!= (unsigned long long __lhs, decimal32 __rhs)
bool operator!= (unsigned long long __lhs, decimal64 __rhs)

operator* โ€” multiplication, but make it โœจexhaustiveโœจ

Same deal, bestie: every decimal-vs-decimal and decimal-vs-integer pairing. Notice how the return type changes depending on who's on the left โ€” like the result is whichever decimal type the operation is vibing with. So iconic of it. ๐Ÿ”ฅ

decimal128 operator* (decimal128 __lhs, decimal128 __rhs)
decimal128 operator* (decimal128 __lhs, decimal32 __rhs)
decimal128 operator* (decimal128 __lhs, decimal64 __rhs)
decimal128 operator* (decimal128 __lhs, int __rhs)
decimal128 operator* (decimal128 __lhs, long __rhs)
decimal128 operator* (decimal128 __lhs, long long __rhs)
decimal128 operator* (decimal128 __lhs, unsigned int __rhs)
decimal128 operator* (decimal128 __lhs, unsigned long __rhs)
decimal128 operator* (decimal128 __lhs, unsigned long long __rhs)
decimal128 operator* (decimal32 __lhs, decimal128 __rhs)
decimal32 operator* (decimal32 __lhs, decimal32 __rhs)
decimal64 operator* (decimal32 __lhs, decimal64 __rhs)
decimal32 operator* (decimal32 __lhs, int __rhs)
decimal32 operator* (decimal32 __lhs, long __rhs)
decimal32 operator* (decimal32 __lhs, long long __rhs)
decimal32 operator* (decimal32 __lhs, unsigned int __rhs)
decimal32 operator* (decimal32 __lhs, unsigned long __rhs)
decimal32 operator* (decimal32 __lhs, unsigned long long __rhs)
decimal128 operator* (decimal64 __lhs, decimal128 __rhs)
decimal64 operator* (decimal64 __lhs, decimal32 __rhs)
decimal64 operator* (decimal64 __lhs, decimal64 __rhs)
decimal64 operator* (decimal64 __lhs, int __rhs)
decimal64 operator* (decimal64 __lhs, long __rhs)
decimal64 operator* (decimal64 __lhs, long long __rhs)
decimal64 operator* (decimal64 __lhs, unsigned int __rhs)
decimal64 operator* (decimal64 __lhs, unsigned long __rhs)
decimal64 operator* (decimal64 __lhs, unsigned long long __rhs)
decimal128 operator* (int __lhs, decimal128 __rhs)
decimal32 operator* (int __lhs, decimal32 __rhs)
decimal64 operator* (int __lhs, decimal64 __rhs)
decimal128 operator* (long __lhs, decimal128 __rhs)
decimal32 operator* (long __lhs, decimal32 __rhs)
decimal64 operator* (long __lhs, decimal64 __rhs)
decimal128 operator* (long long __lhs, decimal128 __rhs)
decimal32 operator* (long long __lhs, decimal32 __rhs)
decimal64 operator* (long long __lhs, decimal64 __rhs)
decimal128 operator* (unsigned int __lhs, decimal128 __rhs)
decimal32 operator* (unsigned int __lhs, decimal32 __rhs)
decimal64 operator* (unsigned int __lhs, decimal64 __rhs)
decimal128 operator* (unsigned long __lhs, decimal128 __rhs)
decimal32 operator* (unsigned long __lhs, decimal32 __rhs)
decimal64 operator* (unsigned long __lhs, decimal64 __rhs)
decimal128 operator* (unsigned long long __lhs, decimal128 __rhs)
decimal32 operator* (unsigned long long __lhs, decimal32 __rhs)
decimal64 operator* (unsigned long long __lhs, decimal64 __rhs)

operator+ โ€” and yes, there's unary now too ๐Ÿ‘‘

The glow-up here: alongside all the two-argument versions, you also get the unary plus for each decimal type โ€” decimal128 operator+ (decimal128 __rhs), decimal32 operator+ (decimal32 __rhs), decimal64 operator+ (decimal64 __rhs). One argument, main character energy, no notes. ๐ŸŽ€

decimal128 operator+ (decimal128 __lhs, decimal128 __rhs)
decimal128 operator+ (decimal128 __lhs, decimal32 __rhs)
decimal128 operator+ (decimal128 __lhs, decimal64 __rhs)
decimal128 operator+ (decimal128 __lhs, int __rhs)
decimal128 operator+ (decimal128 __lhs, long __rhs)
decimal128 operator+ (decimal128 __lhs, long long __rhs)
decimal128 operator+ (decimal128 __lhs, unsigned int __rhs)
decimal128 operator+ (decimal128 __lhs, unsigned long __rhs)
decimal128 operator+ (decimal128 __lhs, unsigned long long __rhs)
decimal128 operator+ (decimal128 __rhs)
decimal128 operator+ (decimal32 __lhs, decimal128 __rhs)
decimal32 operator+ (decimal32 __lhs, decimal32 __rhs)
decimal64 operator+ (decimal32 __lhs, decimal64 __rhs)
decimal32 operator+ (decimal32 __lhs, int __rhs)
decimal32 operator+ (decimal32 __lhs, long __rhs)
decimal32 operator+ (decimal32 __lhs, long long __rhs)
decimal32 operator+ (decimal32 __lhs, unsigned int __rhs)
decimal32 operator+ (decimal32 __lhs, unsigned long __rhs)
decimal32 operator+ (decimal32 __lhs, unsigned long long __rhs)
decimal32 operator+ (decimal32 __rhs)
decimal128 operator+ (decimal64 __lhs, decimal128 __rhs)
decimal64 operator+ (decimal64 __lhs, decimal32 __rhs)
decimal64 operator+ (decimal64 __lhs, decimal64 __rhs)
decimal64 operator+ (decimal64 __lhs, int __rhs)
decimal64 operator+ (decimal64 __lhs, long __rhs)
decimal64 operator+ (decimal64 __lhs, long long __rhs)
decimal64 operator+ (decimal64 __lhs, unsigned int __rhs)
decimal64 operator+ (decimal64 __lhs, unsigned long __rhs)
decimal64 operator+ (decimal64 __lhs, unsigned long long __rhs)
decimal64 operator+ (decimal64 __rhs)
decimal128 operator+ (int __lhs, decimal128 __rhs)
decimal32 operator+ (int __lhs, decimal32 __rhs)
decimal64 operator+ (int __lhs, decimal64 __rhs)
decimal128 operator+ (long __lhs, decimal128 __rhs)
decimal32 operator+ (long __lhs, decimal32 __rhs)
decimal64 operator+ (long __lhs, decimal64 __rhs)
decimal128 operator+ (long long __lhs, decimal128 __rhs)
decimal32 operator+ (long long __lhs, decimal32 __rhs)
decimal64 operator+ (long long __lhs, decimal64 __rhs)
decimal128 operator+ (unsigned int __lhs, decimal128 __rhs)
decimal32 operator+ (unsigned int __lhs, decimal32 __rhs)
decimal64 operator+ (unsigned int __lhs, decimal64 __rhs)
decimal128 operator+ (unsigned long __lhs, decimal128 __rhs)
decimal32 operator+ (unsigned long __lhs, decimal32 __rhs)
decimal64 operator+ (unsigned long __lhs, decimal64 __rhs)
decimal128 operator+ (unsigned long long __lhs, decimal128 __rhs)
decimal32 operator+ (unsigned long long __lhs, decimal32 __rhs)
decimal64 operator+ (unsigned long long __lhs, decimal64 __rhs)

operator- โ€” subtraction (and unary minus, bestie, it's here too) ๐ŸŒ™

Same structure as operator+, and yes the unary minus is in the building: decimal128 operator- (decimal128 __rhs) and decimal32 operator- (decimal32 __rhs) both showed up. (The list keeps going after this, so don't panic if it feels cut off โ€” that's just where this part ends. ๐Ÿ‘€)

decimal128 operator- (decimal128 __lhs, decimal128 __rhs)
decimal128 operator- (decimal128 __lhs, decimal32 __rhs)
decimal128 operator- (decimal128 __lhs, decimal64 __rhs)
decimal128 operator- (decimal128 __lhs, int __rhs)
decimal128 operator- (decimal128 __lhs, long __rhs)
decimal128 operator- (decimal128 __lhs, long long __rhs)
decimal128 operator- (decimal128 __lhs, unsigned int __rhs)
decimal128 operator- (decimal128 __lhs, unsigned long __rhs)
decimal128 operator- (decimal128 __lhs, unsigned long long __rhs)
decimal128 operator- (decimal128 __rhs)
decimal128 operator- (decimal32 __lhs, decimal128 __rhs)
decimal32 operator- (decimal32 __lhs, decimal32 __rhs)
decimal64 operator- (decimal32 __lhs, decimal64 __rhs)
decimal32 operator- (decimal32 __lhs, int __rhs)
decimal32 operator- (decimal32 __lhs, long __rhs)
decimal32 operator- (decimal32 __lhs, long long __rhs)
decimal32 operator- (decimal32 __lhs, unsigned int __rhs)
decimal32 operator- (decimal32 __lhs, unsigned long __rhs)
decimal32 operator- (decimal32 __lhs, unsigned long long __rhs)
decimal32 operator- (decimal32 __rhs)
decimal128 operator- (decimal64 __lhs, decimal128 __rhs)
decimal64 operator- (decimal64 __lhs, decimal32 __rhs)
decimal64 operator- (decimal64 __lhs, decimal64 __rhs)
decimal64 operator- (decimal64 __lhs, int __rhs)
decimal64 operator- (decimal64 __lhs, long __rhs)
decimal64 operator- (decimal64 __lhs, long long __rhs)
decimal64 operator- (decimal64 __lhs, unsigned int __rhs)

okay bestie we're still deep in the SYNOPSIS and the operator- guest list is not done yet โ€” here come the rest of the mixed-type ones plus that one lonely unary minus ๐ŸŽ€

decimal64 operator- (decimal64 __lhs, unsigned long __rhs)
decimal64 operator- (decimal64 __lhs, unsigned long long __rhs)
decimal64 operator- (decimal64 __rhs)
decimal128 operator- (int __lhs, decimal128 __rhs)
decimal32 operator- (int __lhs, decimal32 __rhs)
decimal64 operator- (int __lhs, decimal64 __rhs)
decimal128 operator- (long __lhs, decimal128 __rhs)
decimal32 operator- (long __lhs, decimal32 __rhs)
decimal64 operator- (long __lhs, decimal64 __rhs)
decimal128 operator- (long long __lhs, decimal128 __rhs)
decimal32 operator- (long long __lhs, decimal32 __rhs)
decimal64 operator- (long long __lhs, decimal64 __rhs)
decimal128 operator- (unsigned int __lhs, decimal128 __rhs)
decimal32 operator- (unsigned int __lhs, decimal32 __rhs)
decimal64 operator- (unsigned int __lhs, decimal64 __rhs)
decimal128 operator- (unsigned long __lhs, decimal128 __rhs)
decimal32 operator- (unsigned long __lhs, decimal32 __rhs)
decimal64 operator- (unsigned long __lhs, decimal64 __rhs)
decimal128 operator- (unsigned long long __lhs, decimal128 __rhs)
decimal32 operator- (unsigned long long __lhs, decimal32 __rhs)
decimal64 operator- (unsigned long long __lhs, decimal64 __rhs)

notice how the integer can be on either side โ€” __lhs is an int and __rhs is a decimal, or the other way round, she does both ๐Ÿ’… and decimal64 operator- (decimal64 __rhs) is the unary one: one argument, no __lhs at all, just vibing alone, main character energy ๐Ÿ‘‘.


next up: operator/ and bestie it is exhaustive โ€” every decimal width against every other decimal width and against every integer type, in both directions, fr fr ๐Ÿฆ‹

decimal128 operator/ (decimal128 __lhs, decimal128 __rhs)
decimal128 operator/ (decimal128 __lhs, decimal32 __rhs)
decimal128 operator/ (decimal128 __lhs, decimal64 __rhs)
decimal128 operator/ (decimal128 __lhs, int __rhs)
decimal128 operator/ (decimal128 __lhs, long __rhs)
decimal128 operator/ (decimal128 __lhs, long long __rhs)
decimal128 operator/ (decimal128 __lhs, unsigned int __rhs)
decimal128 operator/ (decimal128 __lhs, unsigned long __rhs)
decimal128 operator/ (decimal128 __lhs, unsigned long long __rhs)
decimal128 operator/ (decimal32 __lhs, decimal128 __rhs)
decimal32 operator/ (decimal32 __lhs, decimal32 __rhs)
decimal64 operator/ (decimal32 __lhs, decimal64 __rhs)
decimal32 operator/ (decimal32 __lhs, int __rhs)
decimal32 operator/ (decimal32 __lhs, long __rhs)
decimal32 operator/ (decimal32 __lhs, long long __rhs)
decimal32 operator/ (decimal32 __lhs, unsigned int __rhs)
decimal32 operator/ (decimal32 __lhs, unsigned long __rhs)
decimal32 operator/ (decimal32 __lhs, unsigned long long __rhs)
decimal128 operator/ (decimal64 __lhs, decimal128 __rhs)
decimal64 operator/ (decimal64 __lhs, decimal32 __rhs)
decimal64 operator/ (decimal64 __lhs, decimal64 __rhs)
decimal64 operator/ (decimal64 __lhs, int __rhs)
decimal64 operator/ (decimal64 __lhs, long __rhs)
decimal64 operator/ (decimal64 __lhs, long long __rhs)
decimal64 operator/ (decimal64 __lhs, unsigned int __rhs)
decimal64 operator/ (decimal64 __lhs, unsigned long __rhs)
decimal64 operator/ (decimal64 __lhs, unsigned long long __rhs)
decimal128 operator/ (int __lhs, decimal128 __rhs)
decimal32 operator/ (int __lhs, decimal32 __rhs)
decimal64 operator/ (int __lhs, decimal64 __rhs)
decimal128 operator/ (long __lhs, decimal128 __rhs)
decimal32 operator/ (long __lhs, decimal32 __rhs)
decimal64 operator/ (long __lhs, decimal64 __rhs)
decimal128 operator/ (long long __lhs, decimal128 __rhs)
decimal32 operator/ (long long __lhs, decimal32 __rhs)
decimal64 operator/ (long long __lhs, decimal64 __rhs)
decimal128 operator/ (unsigned int __lhs, decimal128 __rhs)
decimal32 operator/ (unsigned int __lhs, decimal32 __rhs)
decimal64 operator/ (unsigned int __lhs, decimal64 __rhs)
decimal128 operator/ (unsigned long __lhs, decimal128 __rhs)
decimal32 operator/ (unsigned long __lhs, decimal32 __rhs)
decimal64 operator/ (unsigned long __lhs, decimal64 __rhs)
decimal128 operator/ (unsigned long long __lhs, decimal128 __rhs)
decimal32 operator/ (unsigned long long __lhs, decimal32 __rhs)
decimal64 operator/ (unsigned long long __lhs, decimal64 __rhs)

the result type follows the wider decimal in the room โ€” decimal32 paired with decimal64 gives you back a decimal64, decimal64 paired with decimal128 gives you back a decimal128, and anything with decimal128 is a decimal128. it's giving "whoever's biggest picks the outfit" โœจ


then operator< pulls up with the exact same "every combo, both ways" energy, except these hand you back a bool ๐Ÿ“

bool operator< (decimal128 __lhs, decimal128 __rhs)
bool operator< (decimal128 __lhs, decimal32 __rhs)
bool operator< (decimal128 __lhs, decimal64 __rhs)
bool operator< (decimal128 __lhs, int __rhs)
bool operator< (decimal128 __lhs, long __rhs)
bool operator< (decimal128 __lhs, long long __rhs)
bool operator< (decimal128 __lhs, unsigned int __rhs)
bool operator< (decimal128 __lhs, unsigned long __rhs)
bool operator< (decimal128 __lhs, unsigned long long __rhs)
bool operator< (decimal32 __lhs, decimal128 __rhs)
bool operator< (decimal32 __lhs, decimal32 __rhs)
bool operator< (decimal32 __lhs, decimal64 __rhs)
bool operator< (decimal32 __lhs, int __rhs)
bool operator< (decimal32 __lhs, long __rhs)
bool operator< (decimal32 __lhs, long long __rhs)
bool operator< (decimal32 __lhs, unsigned int __rhs)
bool operator< (decimal32 __lhs, unsigned long __rhs)
bool operator< (decimal32 __lhs, unsigned long long __rhs)
bool operator< (decimal64 __lhs, decimal128 __rhs)
bool operator< (decimal64 __lhs, decimal32 __rhs)
bool operator< (decimal64 __lhs, decimal64 __rhs)
bool operator< (decimal64 __lhs, int __rhs)
bool operator< (decimal64 __lhs, long __rhs)
bool operator< (decimal64 __lhs, long long __rhs)
bool operator< (decimal64 __lhs, unsigned int __rhs)
bool operator< (decimal64 __lhs, unsigned long __rhs)
bool operator< (decimal64 __lhs, unsigned long long __rhs)
bool operator< (int __lhs, decimal128 __rhs)
bool operator< (int __lhs, decimal32 __rhs)
bool operator< (int __lhs, decimal64 __rhs)
bool operator< (long __lhs, decimal128 __rhs)
bool operator< (long __lhs, decimal32 __rhs)
bool operator< (long __lhs, decimal64 __rhs)
bool operator< (long long __lhs, decimal128 __rhs)
bool operator< (long long __lhs, decimal32 __rhs)
bool operator< (long long __lhs, decimal64 __rhs)
bool operator< (unsigned int __lhs, decimal128 __rhs)
bool operator< (unsigned int __lhs, decimal32 __rhs)
bool operator< (unsigned int __lhs, decimal64 __rhs)
bool operator< (unsigned long __lhs, decimal128 __rhs)
bool operator< (unsigned long __lhs, decimal32 __rhs)
bool operator< (unsigned long __lhs, decimal64 __rhs)
bool operator< (unsigned long long __lhs, decimal128 __rhs)
bool operator< (unsigned long long __lhs, decimal32 __rhs)
bool operator< (unsigned long long __lhs, decimal64 __rhs)

and operator==, same shape, same bool, same "we included literally every pairing" dedication ๐Ÿ’œ

bool operator== (decimal128 __lhs, decimal128 __rhs)
bool operator== (decimal128 __lhs, decimal32 __rhs)
bool operator== (decimal128 __lhs, decimal64 __rhs)
bool operator== (decimal128 __lhs, int __rhs)
bool operator== (decimal128 __lhs, long __rhs)
bool operator== (decimal128 __lhs, long long __rhs)
bool operator== (decimal128 __lhs, unsigned int __rhs)
bool operator== (decimal128 __lhs, unsigned long __rhs)
bool operator== (decimal128 __lhs, unsigned long long __rhs)
bool operator== (decimal32 __lhs, decimal128 __rhs)
bool operator== (decimal32 __lhs, decimal32 __rhs)
bool operator== (decimal32 __lhs, decimal64 __rhs)
bool operator== (decimal32 __lhs, int __rhs)
bool operator== (decimal32 __lhs, long __rhs)
bool operator== (decimal32 __lhs, long long __rhs)
bool operator== (decimal32 __lhs, unsigned int __rhs)
bool operator== (decimal32 __lhs, unsigned long __rhs)
bool operator== (decimal32 __lhs, unsigned long long __rhs)
bool operator== (decimal64 __lhs, decimal128 __rhs)
bool operator== (decimal64 __lhs, decimal32 __rhs)
bool operator== (decimal64 __lhs, decimal64 __rhs)
bool operator== (decimal64 __lhs, int __rhs)
bool operator== (decimal64 __lhs, long __rhs)
bool operator== (decimal64 __lhs, long long __rhs)
bool operator== (decimal64 __lhs, unsigned int __rhs)
bool operator== (decimal64 __lhs, unsigned long __rhs)
bool operator== (decimal64 __lhs, unsigned long long __rhs)
bool operator== (int __lhs, decimal128 __rhs)
bool operator== (int __lhs, decimal32 __rhs)
bool operator== (int __lhs, decimal64 __rhs)
bool operator== (long __lhs, decimal128 __rhs)
bool operator== (long __lhs, decimal32 __rhs)
bool operator== (long __lhs, decimal64 __rhs)
bool operator== (long long __lhs, decimal128 __rhs)
bool operator== (long long __lhs, decimal32 __rhs)
bool operator== (long long __lhs, decimal64 __rhs)
bool operator== (unsigned int __lhs, decimal128 __rhs)
bool operator== (unsigned int __lhs, decimal32 __rhs)
bool operator== (unsigned int __lhs, decimal64 __rhs)
bool operator== (unsigned long __lhs, decimal128 __rhs)
bool operator== (unsigned long __lhs, decimal32 __rhs)
bool operator== (unsigned long __lhs, decimal64 __rhs)
bool operator== (unsigned long long __lhs, decimal128 __rhs)
bool operator== (unsigned long long __lhs, decimal32 __rhs)
bool operator== (unsigned long long __lhs, decimal64 __rhs)

and then operator> rolls in like she owns the place ๐Ÿ‘‘ same pattern, still bool, and heads up bestie โ€” this list does not end here, it keeps going into the next part, so we stop exactly where the page stops, no cap ๐Ÿ’€

bool operator> (decimal128 __lhs, decimal128 __rhs)
bool operator> (decimal128 __lhs, decimal32 __rhs)
bool operator> (decimal128 __lhs, decimal64 __rhs)
bool operator> (decimal128 __lhs, int __rhs)
bool operator> (decimal128 __lhs, long __rhs)
bool operator> (decimal128 __lhs, long long __rhs)
bool operator> (decimal128 __lhs, unsigned int __rhs)
bool operator> (decimal128 __lhs, unsigned long __rhs)
bool operator> (decimal128 __lhs, unsigned long long __rhs)
bool operator> (decimal32 __lhs, decimal128 __rhs)
bool operator> (decimal32 __lhs, decimal32 __rhs)
bool operator> (decimal32 __lhs, decimal64 __rhs)
bool operator> (decimal32 __lhs, int __rhs)
bool operator> (decimal32 __lhs, long __rhs)
bool operator> (decimal32 __lhs, long long __rhs)
bool operator> (decimal32 __lhs, unsigned int __rhs)
bool operator> (decimal32 __lhs, unsigned long __rhs)
bool operator> (decimal32 __lhs, unsigned long long __rhs)
bool operator> (decimal64 __lhs, decimal128 __rhs)
bool operator> (decimal64 __lhs, decimal32 __rhs)
bool operator> (decimal64 __lhs, decimal64 __rhs)
bool operator> (decimal64 __lhs, int __rhs)
bool operator> (decimal64 __lhs, long __rhs)
bool operator> (decimal64 __lhs, long long __rhs)
bool operator> (decimal64 __lhs, unsigned int __rhs)
bool operator> (decimal64 __lhs, unsigned long __rhs)
bool operator> (decimal64 __lhs, unsigned long long __rhs)
bool operator> (int __lhs, decimal128 __rhs)
bool operator> (int __lhs, decimal32 __rhs)
bool operator> (int __lhs, decimal64 __rhs)
bool operator> (long __lhs, decimal128 __rhs)
bool operator> (long __lhs, decimal32 __rhs)
bool operator> (long __lhs, decimal64 __rhs)
bool operator> (long long __lhs, decimal128 __rhs)
bool operator> (long long __lhs, decimal32 __rhs)
bool operator> (long long __lhs, decimal64 __rhs)
bool operator> (unsigned int __lhs, decimal128 __rhs)
bool operator> (unsigned int __lhs, decimal32 __rhs)
bool operator> (unsigned int __lhs, decimal64 __rhs)
bool operator> (unsigned long __lhs, decimal128 __rhs)
bool operator> (unsigned long __lhs, decimal32 __rhs)
bool operator> (unsigned long __lhs, decimal64 __rhs)
bool operator> (unsigned long long __lhs, decimal128 __rhs)
bool operator> (unsigned long long __lhs, decimal32 __rhs)

...and the list just keeps going, bestie, I'm not even joking ๐Ÿ˜ญ but we do not skip a single overload in this house, so here's the rest of them, every last one, periodt ๐Ÿ’…

bool operator> (unsigned long long __lhs, decimal64 __rhs)
bool operator>= (decimal128 __lhs, decimal128 __rhs)
bool operator>= (decimal128 __lhs, decimal32 __rhs)
bool operator>= (decimal128 __lhs, decimal64 __rhs)
bool operator>= (decimal128 __lhs, int __rhs)
bool operator>= (decimal128 __lhs, long __rhs)
bool operator>= (decimal128 __lhs, long long __rhs)
bool operator>= (decimal128 __lhs, unsigned int __rhs)
bool operator>= (decimal128 __lhs, unsigned long __rhs)
bool operator>= (decimal128 __lhs, unsigned long long __rhs)
bool operator>= (decimal32 __lhs, decimal128 __rhs)
bool operator>= (decimal32 __lhs, decimal32 __rhs)
bool operator>= (decimal32 __lhs, decimal64 __rhs)
bool operator>= (decimal32 __lhs, int __rhs)
bool operator>= (decimal32 __lhs, long __rhs)
bool operator>= (decimal32 __lhs, long long __rhs)
bool operator>= (decimal32 __lhs, unsigned int __rhs)
bool operator>= (decimal32 __lhs, unsigned long __rhs)
bool operator>= (decimal32 __lhs, unsigned long long __rhs)
bool operator>= (decimal64 __lhs, decimal128 __rhs)
bool operator>= (decimal64 __lhs, decimal32 __rhs)
bool operator>= (decimal64 __lhs, decimal64 __rhs)
bool operator>= (decimal64 __lhs, int __rhs)
bool operator>= (decimal64 __lhs, long __rhs)
bool operator>= (decimal64 __lhs, long long __rhs)
bool operator>= (decimal64 __lhs, unsigned int __rhs)
bool operator>= (decimal64 __lhs, unsigned long __rhs)
bool operator>= (decimal64 __lhs, unsigned long long __rhs)
bool operator>= (int __lhs, decimal128 __rhs)
bool operator>= (int __lhs, decimal32 __rhs)
bool operator>= (int __lhs, decimal64 __rhs)
bool operator>= (long __lhs, decimal128 __rhs)
bool operator>= (long __lhs, decimal32 __rhs)
bool operator>= (long __lhs, decimal64 __rhs)
bool operator>= (long long __lhs, decimal128 __rhs)
bool operator>= (long long __lhs, decimal32 __rhs)
bool operator>= (long long __lhs, decimal64 __rhs)
bool operator>= (unsigned int __lhs, decimal128 __rhs)
bool operator>= (unsigned int __lhs, decimal32 __rhs)
bool operator>= (unsigned int __lhs, decimal64 __rhs)
bool operator>= (unsigned long __lhs, decimal128 __rhs)
bool operator>= (unsigned long __lhs, decimal32 __rhs)
bool operator>= (unsigned long __lhs, decimal64 __rhs)
bool operator>= (unsigned long long __lhs, decimal128 __rhs)
bool operator>= (unsigned long long __lhs, decimal32 __rhs)
bool operator>= (unsigned long long __lhs, decimal64 __rhs)

โœจ Detailed Description โœจ

Okay so what even is this whole page? It's all about ISO/IEC TR 24733 โ€” that's the standard for decimal floating-point arithmetic. ๐Ÿฆ‹ That's the vibe. That's the entire assignment. No cap.


๐Ÿ”ง Function Documentation ๐Ÿ”ง

long long std::decimal::decimal32_to_long_long (decimal32 __d) ๐ŸŒˆ

Non-conforming extension: conversion to integral type. ๐Ÿ‘‘

Heads up bestie: this one is a non-conforming extension โ€” it's not part of the standard, so don't expect it to show up everywhere. It takes a decimal32 __d and gives you back a long long. That's the whole deal. ๐Ÿ’œ

๐ŸŽ€ Author ๐ŸŽ€

Generated automatically by <strong>Doxygen</strong> for <strong>libstdc++</strong> from the source code.</purgle>

(no actual human wrote this prose, it just materialized โœจ iconic behaviour honestly)


And that's a wrap on the whole page, bestie!! ๐Ÿซถ๐ŸŒธ We read every single overload, we survived, we're stronger for it. The source of all this is libstdc++ and the page itself lives in section 3 of the manual as std::decimal(3) โ€” go forth and do decimal math responsibly, mwah ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 ยท GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • centos-stream 10: gcc-toolset-15-libstdc++-docs 15.2.1-8.1.el10 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • centos-stream 10: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el10 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • centos-stream 10: libstdc++-docs 14.4.1-4.el10 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 43: libstdc++-docs 15.2.1-2.fc43 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 43: libstdc++-docs 15.3.1-1.fc43 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms