1#ifndef SAFEHERON_SGX_TRUSTED_DECIMAL_H
2#define SAFEHERON_SGX_TRUSTED_DECIMAL_H
104 [[nodiscard]] mpd_context_t* Get()
const;
105 mpd_context_t* ptr_ctx_;
434 [[nodiscard]] std::string
ToStr()
const;
459 static void SetDefaultContext(mpd_context_t* ptr_ctx);
High precision big number class This class implements the basic calculation and comparison operations...
Definition ssgx_decimal_t.h:125
static bool IsValidDecimal(const char *expr)
To check a string is a valid expression of BigDecimal or not.
BigDecimal Div(const BigDecimal &num, const Precision &prec) const
BigDecimal Sub(const BigDecimal &num) const
Subtraction of Numbers. Return a new BigDecimal object which equal to (*this) - num.
BigDecimal & operator=(BigDecimal &&num) noexcept
The move and assignment operator.
bool operator>=(const BigDecimal &num) const
Comparison operator: greater than or equal to.
BigDecimal(const BigDecimal &num)
The copy constructor Construct a BigDecimal objet and copy the value from num.
BigDecimal Add(const BigDecimal &num, const Precision &prec) const
BigDecimal()
Construct a BigDecimal object and initialized it with "0".
bool operator==(const BigDecimal &num) const
Comparison operator: equal to.
BigDecimal Sub(const BigDecimal &num, const Precision &prec) const
BigDecimal Div(const BigDecimal &num) const
Division of Numbers. Return a new BigDecimal object which equal to (*this) / num.
bool operator>(const BigDecimal &num) const
Comparison operator: greater than.
BigDecimal SetScale(int scale, RoundType round_type=RoundType::RoundHalfUp) const
Set the number of significant decimal places for this BigDecimal.
BigDecimal Neg() const
Take the opposite number.
BigDecimal Multiply(const BigDecimal &num, const Precision &prec) const
BigDecimal(BigDecimal &&num) noexcept
The move constructor Construct a BigDecimal object and move the value from num The num object's membe...
bool operator<=(const BigDecimal &num) const
Comparison operator: less than or equal to.
bool operator<(const BigDecimal &num) const
Comparison operator: less than.
virtual ~BigDecimal()
Destruction.
BigDecimal(const char *str)
Construct a BigDecimal objet and initialized it with str.
BigDecimal & operator=(const BigDecimal &num)
The copy assignment operator.
bool operator!=(const BigDecimal &num) const
Comparison operator: not equal to.
BigDecimal Add(const BigDecimal &num) const
Addition of Numbers Return a new BigDecimal object which equal to (*this) + num.
BigDecimal Multiply(const BigDecimal &num) const
Multiplication of Numbers. Return a new BigDecimal object which equal to (*this) * num.
std::string ToStr() const
Conversion to decimal string in default precision.
std::string ToStr(int scale, RoundType round_type) const
Conversion to decimal string is customized precision and rounding policy.
Precision control class The Precision class is used to configure the number of digits and rounding ty...
Definition ssgx_decimal_t.h:57
Precision(RoundType round_type, int scale)
Constructor.
RoundType
Rounding type for precision control.
Definition ssgx_decimal_t.h:39
Definition ssgx_attestation_t.h:6