|
GnuCash c935c2f+
|
Public Types | |
| enum | { pos = 0 , neg = 1 , overflow = 2 , NaN = 4 } |
Public Member Functions | |
| GncInt128 () | |
| Default constructor. | |
| template<typename T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| GncInt128 (T lower) | |
| GncInt128 (uint64_t lower) | |
| template<typename T , typename U , std::enable_if_t<(std::is_integral< T >::value &&std::is_integral< U >::value), bool > = true> | |
| GncInt128 (T upper, U lower, unsigned char flags='\0') | |
| Double-integer constructor template. | |
| GncInt128 (int64_t upper, int64_t lower, unsigned char flags='\0') | |
| template<typename T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| GncInt128 (T upper, uint64_t lower) | |
| GncInt128 (int64_t upper, uint64_t lower, unsigned char flags='\0') | |
| GncInt128 (uint64_t upper, uint64_t lower, unsigned char flags='\0') | |
| GncInt128 & | zero () noexcept |
| Clear the object. | |
| int | cmp (const GncInt128 &b) const noexcept |
| Compare function. | |
| GncInt128 | gcd (GncInt128 b) const noexcept |
| Computes the Greatest Common Divisor between the object and parameter. | |
| GncInt128 | lcm (const GncInt128 &b) const noexcept |
| Computes the Least Common Multiple between the object and parameter. | |
| GncInt128 | pow (unsigned int n) const noexcept |
| Computes the object raised to the parameter's power. | |
| void | div (const GncInt128 &d, GncInt128 &q, GncInt128 &r) const noexcept |
| Computes a quotient and a remainder, passed as reference parameters. | |
| operator int64_t () const | |
| Explicit conversion to int64_t. | |
| operator uint64_t () const | |
| Explicit conversion to uint64_t. | |
| bool | isNeg () const noexcept |
| bool | isBig () const noexcept |
| bool | isOverflow () const noexcept |
| bool | isNan () const noexcept |
| bool | isZero () const noexcept |
| bool | valid () const noexcept |
| unsigned int | bits () const noexcept |
| char * | asCharBufR (char *buf, uint32_t size) const noexcept |
| Fills a supplied buffer with a representation of the number in base 10. | |
| GncInt128 | abs () const noexcept |
| GncInt128 | operator- () const noexcept |
| operator bool () const noexcept | |
| GncInt128 & | operator++ () noexcept |
| GncInt128 & | operator++ (int) noexcept |
| GncInt128 & | operator-- () noexcept |
| GncInt128 & | operator-- (int) noexcept |
| GncInt128 & | operator<<= (unsigned int i) noexcept |
| GncInt128 & | operator>>= (unsigned int i) noexcept |
| GncInt128 & | operator+= (const GncInt128 &b) noexcept |
| GncInt128 & | operator-= (const GncInt128 &b) noexcept |
| GncInt128 & | operator*= (const GncInt128 &b) noexcept |
| GncInt128 & | operator/= (const GncInt128 &b) noexcept |
| GncInt128 & | operator%= (const GncInt128 &b) noexcept |
| GncInt128 & | operator&= (const GncInt128 &b) noexcept |
| GncInt128 & | operator|= (const GncInt128 &b) noexcept |
| GncInt128 & | operator^= (const GncInt128 &b) noexcept |
Static Public Attributes | |
| static const unsigned int | flagbits = 3 |
| static const unsigned int | numlegs = 2 |
| static const unsigned int | legbits = 64 |
| static const unsigned int | maxbits = legbits * numlegs - flagbits |
Definition at line 61 of file gnc-int128.hpp.
| anonymous enum |
Definition at line 72 of file gnc-int128.hpp.
|
noexcept |
Definition at line 284 of file gnc-int128.cpp.
|
noexcept |
Fills a supplied buffer with a representation of the number in base 10.
If the GncInt128 is overflowed or NaN it will contain the words "Overflow" or "NaN" respectively.
| buf | char[41], 39 digits plus sign and trailing 0. |
Definition at line 918 of file gnc-int128.cpp.
|
noexcept |
Definition at line 293 of file gnc-int128.cpp.
|
noexcept |
Compare function.
Definition at line 151 of file gnc-int128.cpp.
Computes a quotient and a remainder, passed as reference parameters.
'this' is the dividend. The quotient and remainder args must be initialized to zero.
| d | The divisor |
| q | The quotient; will be NaN if divisor = 0 |
| r | The remainder; will be 0 if divisor = 0 |
Definition at line 723 of file gnc-int128.cpp.
Computes the Greatest Common Divisor between the object and parameter.
Definition at line 182 of file gnc-int128.cpp.
|
noexcept |
Definition at line 253 of file gnc-int128.cpp.
|
noexcept |
Definition at line 265 of file gnc-int128.cpp.
|
noexcept |
Definition at line 247 of file gnc-int128.cpp.
|
noexcept |
Definition at line 259 of file gnc-int128.cpp.
|
noexcept |
Definition at line 277 of file gnc-int128.cpp.
Computes the Least Common Multiple between the object and parameter.
Definition at line 221 of file gnc-int128.cpp.
|
explicitnoexcept |
Definition at line 317 of file gnc-int128.cpp.
|
explicit |
Explicit conversion to int64_t.
| std::overflow_error | if the object's value is > INT64_MAX or NaN. |
| std::underflow_error | if the object's value is < INT64_MIN |
Definition at line 128 of file gnc-int128.cpp.
|
explicit |
Explicit conversion to uint64_t.
| std::overflow_error | if the object's value is > UINT64_MAX or NaN. |
| std::underflow_error | if the object's value is < 0. |
Definition at line 139 of file gnc-int128.cpp.
Definition at line 816 of file gnc-int128.cpp.
Definition at line 827 of file gnc-int128.cpp.
Definition at line 475 of file gnc-int128.cpp.
|
noexcept |
Definition at line 323 of file gnc-int128.cpp.
|
noexcept |
Definition at line 329 of file gnc-int128.cpp.
Definition at line 347 of file gnc-int128.cpp.
|
noexcept |
Definition at line 305 of file gnc-int128.cpp.
|
noexcept |
Definition at line 335 of file gnc-int128.cpp.
|
noexcept |
Definition at line 341 of file gnc-int128.cpp.
Definition at line 427 of file gnc-int128.cpp.
Definition at line 807 of file gnc-int128.cpp.
|
noexcept |
Definition at line 371 of file gnc-int128.cpp.
|
noexcept |
Definition at line 401 of file gnc-int128.cpp.
Definition at line 856 of file gnc-int128.cpp.
Definition at line 845 of file gnc-int128.cpp.
|
noexcept |
Computes the object raised to the parameter's power.
| b | The power to raise this to. No point in taking a GncInt128, any value greater than 128 would overflow on any value other than 1. |
Definition at line 229 of file gnc-int128.cpp.
|
noexcept |
Definition at line 271 of file gnc-int128.cpp.
|
noexcept |
Clear the object.
Sets all member variables to zero.
Definition at line 122 of file gnc-int128.cpp.
|
static |
Definition at line 67 of file gnc-int128.hpp.
|
static |
Definition at line 69 of file gnc-int128.hpp.
|
static |
Definition at line 70 of file gnc-int128.hpp.
|
static |
Definition at line 68 of file gnc-int128.hpp.