|
|
| BigInt () |
| | Default constructor, initializes to zero.
|
| |
| | BigInt (const Location &value) |
| | Constructs a BigInt from a Location representing a arbitrary precision integer string.
|
| |
| | BigInt (std::int64_t value) |
| | Constructs a BigInt from a 64-bit integer.
|
| |
| const Location & | loc () const |
| | Gets the Location representing the integer string.
|
| |
| std::optional< std::int64_t > | to_int () const |
| | Attempts to convert the BigInt to a 64-bit integer.
|
| |
| std::optional< std::size_t > | to_size () const |
| | Attempts to convert the BigInt to a size_t integer.
|
| |
| bool | is_negative () const |
| | Checks if the BigInt is negative.
|
| |
| bool | is_zero () const |
| | Checks if the BigInt is zero.
|
| |
| BigInt | increment () const |
| | Increments the BigInt by one.
|
| |
| BigInt | decrement () const |
| | Decrements the BigInt by one.
|
| |
| BigInt | abs () const |
| | Gets the absolute value of the BigInt.
|
| |
| BigInt | negate () const |
| | Negates the BigInt.
|
| |
|
| BigInt | operator+ (const BigInt &lhs, const BigInt &rhs) |
| | Adds two BigInts.
|
| |
| BigInt | operator- (const BigInt &lhs, const BigInt &rhs) |
| | Subtracts two BigInts.
|
| |
| BigInt | operator* (const BigInt &lhs, const BigInt &rhs) |
| | Multiplies two BigInts.
|
| |
| BigInt | operator/ (const BigInt &lhs, const BigInt &rhs) |
| | Divides two BigInts.
|
| |
| BigInt | operator% (const BigInt &lhs, const BigInt &rhs) |
| | Computes the remainder of dividing two BigInts.
|
| |
| bool | operator> (const BigInt &lhs, const BigInt &rhs) |
| | Compares two BigInts for greater-than.
|
| |
| bool | operator< (const BigInt &lhs, const BigInt &rhs) |
| | Compares two BigInts for less-than.
|
| |
| bool | operator<= (const BigInt &lhs, const BigInt &rhs) |
| | Compares two BigInts for less-than-or-equal.
|
| |
| bool | operator>= (const BigInt &lhs, const BigInt &rhs) |
| | Compares two BigInts for greater-than-or-equal.
|
| |
| bool | operator== (const BigInt &lhs, const BigInt &rhs) |
| | Compares two BigInts for equality.
|
| |
| bool | operator!= (const BigInt &lhs, const BigInt &rhs) |
| | Compares two BigInts for inequality.
|
| |
| std::ostream & | operator<< (std::ostream &os, const BigInt &value) |
| | Outputs a BigInt to a stream.
|
| |
Big Integer implemention based on strings.
using strings. In most circumstances this would be considerably slower than other approaches, but given the way in which Trieste nodes store their content as Location objects into a source document, and given how this class operates over those Locations, it is actually quite efficient when compared to parsing and serializing the Location into a vector of unsigned longs.