统一命名

This commit is contained in:
ArchZer0
2026-08-16 19:15:19 +08:00
parent 9cb17262eb
commit 2a6c53d5bf
8 changed files with 451 additions and 321 deletions
+10 -10
View File
@@ -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);
};