SHA256
统一命名
This commit is contained in:
@@ -17,9 +17,9 @@ public:
|
||||
BigInteger(const BigInteger& other) = default;
|
||||
BigInteger& operator=(const BigInteger& other) = default;
|
||||
|
||||
bool isZero() const;
|
||||
int sign() const;
|
||||
std::string toString() const;
|
||||
[[nodiscard]] bool isZero() const;
|
||||
[[nodiscard]] int sign() const;
|
||||
[[nodiscard]] std::string toString() const;
|
||||
|
||||
bool operator==(const BigInteger& other) const;
|
||||
bool operator!=(const BigInteger& other) const;
|
||||
@@ -55,14 +55,14 @@ public:
|
||||
BigInteger operator/(const BigInteger& other) const;
|
||||
|
||||
private:
|
||||
std::string digits_; // 无符号数字,从高位到低位
|
||||
int sign_; // -1, 0, 1
|
||||
std::string m_digits; // 无符号数字,从高位到低位
|
||||
int m_sign; // -1, 0, 1
|
||||
|
||||
static std::string trimLeadingZeros(const std::string& value);
|
||||
static int compareAbs(const std::string& a, const std::string& b);
|
||||
static std::string addAbs(const std::string& a, const std::string& b);
|
||||
static std::string subAbs(const std::string& a, const std::string& b);
|
||||
static std::string mulAbs(const std::string& a, const std::string& b);
|
||||
static std::string m_trimLeadingZeros(const std::string& value);
|
||||
static int m_compareAbs(const std::string& a, const std::string& b);
|
||||
static std::string m_addAbs(const std::string& a, const std::string& b);
|
||||
static std::string m_subAbs(const std::string& a, const std::string& b);
|
||||
static std::string m_mulAbs(const std::string& a, const std::string& b);
|
||||
static std::string divAbs(const std::string& a, const std::string& b);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user