ledger-core
Public Member Functions | List of all members
ledger::core::api::BigIntImpl Class Reference
+ Inheritance diagram for ledger::core::api::BigIntImpl:
+ Collaboration diagram for ledger::core::api::BigIntImpl:

Public Member Functions

 BigIntImpl (const ledger::core::BigInt &v)
 
virtual std::shared_ptr< ledger::core::api::BigIntadd (const std::shared_ptr< ledger::core::api::BigInt > &i) override
 
virtual std::shared_ptr< ledger::core::api::BigIntsubtract (const std::shared_ptr< ledger::core::api::BigInt > &i) override
 
virtual std::shared_ptr< ledger::core::api::BigIntmultiply (const std::shared_ptr< ledger::core::api::BigInt > &i) override
 
virtual std::shared_ptr< ledger::core::api::BigIntdivide (const std::shared_ptr< ledger::core::api::BigInt > &i) override
 
virtual std::vector< std::shared_ptr< ledger::core::api::BigInt > > divideAndRemainder (const std::shared_ptr< ledger::core::api::BigInt > &i) override
 
virtual std::shared_ptr< ledger::core::api::BigIntpow (int32_t exponent) override
 
virtual std::string toDecimalString (int32_t precision, const std::string &decimalSeparator, const std::string &thousandSeparator) override
 
virtual int32_t intValue () override
 
virtual int32_t compare (const std::shared_ptr< ledger::core::api::BigInt > &i) override
 
virtual std::string toString (int32_t radix) override
 
- Public Member Functions inherited from ledger::core::api::BigInt
virtual std::shared_ptr< BigIntadd (const std::shared_ptr< BigInt > &i)=0
 
virtual std::shared_ptr< BigIntsubtract (const std::shared_ptr< BigInt > &i)=0
 
virtual std::shared_ptr< BigIntmultiply (const std::shared_ptr< BigInt > &i)=0
 
virtual std::shared_ptr< BigIntdivide (const std::shared_ptr< BigInt > &i)=0
 
virtual std::vector< std::shared_ptr< BigInt > > divideAndRemainder (const std::shared_ptr< BigInt > &i)=0
 
virtual int32_t compare (const std::shared_ptr< BigInt > &i)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from ledger::core::api::BigInt
static std::shared_ptr< BigIntfromDecimalString (const std::string &s, int32_t precision, const std::string &decimalSeparator)
 
static std::shared_ptr< BigIntfromIntegerString (const std::string &s, int32_t radix)
 
static std::shared_ptr< BigIntfromLong (int64_t l)
 

Member Function Documentation

◆ intValue()

int32_t ledger::core::api::BigIntImpl::intValue ( )
overridevirtual

Returns the int representation of this BigInt. Note that if the BigInt is greater than 4 bytes the returned value will be meaningless.

Returns
The int representation of this BigInt

Implements ledger::core::api::BigInt.

◆ pow()

std::shared_ptr< ledger::core::api::BigInt > ledger::core::api::BigIntImpl::pow ( int32_t  exponent)
overridevirtual

Raises this BigInt with an interger value. i The exponent to which thi BigInt is raised

Returns
The result of this ^ exponent

Implements ledger::core::api::BigInt.

◆ toDecimalString()

std::string ledger::core::api::BigIntImpl::toDecimalString ( int32_t  precision,
const std::string &  decimalSeparator,
const std::string &  thousandSeparator 
)
overridevirtual

Formats this BigInt to a decimal string (e.g. BigInt("12345").toDecimalString(1, ".", ",") => "1,234.5"). precision The power of ten by wich this BigInt is divided decimalSeparator The separator to use between the integer part and the decimal part thousandSeparator The separator to use between each group of thousand units

Returns
The BigInt formatted as a decimal string

Implements ledger::core::api::BigInt.

◆ toString()

std::string ledger::core::api::BigIntImpl::toString ( int32_t  radix)
overridevirtual

Formats this BigInt to the interger representation of its internal value. radix The radix of the number representation in which to format (right now 10 or 16)

Implements ledger::core::api::BigInt.


The documentation for this class was generated from the following files: