统一命名

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
@@ -18,11 +18,11 @@ public:
BigDecimal(const BigDecimal& other) = default;
BigDecimal& operator=(const BigDecimal& other) = default;
bool isZero() const;
int sign() const;
int getScale() const;
BigInteger getUnscaledValue() const;
std::string toString() const;
[[nodiscard]] bool isZero() const;
[[nodiscard]] int sign() const;
[[nodiscard]] int getScale() const;
[[nodiscard]] BigInteger getUnscaledValue() const;
[[nodiscard]] std::string toString() const;
// Comparison operators
bool operator==(const BigDecimal& other) const;
@@ -59,14 +59,14 @@ public:
BigDecimal operator*(const BigDecimal& other) const;
BigDecimal operator/(const BigDecimal& other) const;
BigDecimal abs() const;
BigDecimal round(int scale) const;
[[nodiscard]] BigDecimal abs() const;
[[nodiscard]] BigDecimal round(int scale) const;
private:
BigInteger unscaledValue_; // 去掉小数点后的值
int scale_; // 小数点后的位数
BigInteger m_unscaledValue; // 去掉小数点后的值
int m_scale; // 小数点后的位数
static void alignScale(BigInteger& lhs, int& lhsScale,
static void m_alignScale(BigInteger& lhs, int& lhsScale,
BigInteger& rhs, int& rhsScale);
};