compiles with tests, milestones: chain add, chain sub
This commit is contained in:
@@ -15,7 +15,7 @@ namespace bigmath {
|
||||
|
||||
private:
|
||||
|
||||
u8 digits[128];
|
||||
u8 digits[64];
|
||||
|
||||
public:
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace bigmath {
|
||||
|
||||
segment(u64 n);
|
||||
|
||||
segment(const segment& s);
|
||||
|
||||
~segment();
|
||||
|
||||
public:
|
||||
@@ -31,10 +33,22 @@ namespace bigmath {
|
||||
|
||||
void set(u8 i, u8 n);
|
||||
|
||||
u8 add(const segment& s, u8 carry);
|
||||
|
||||
u8 sub(const segment& s, u8 borrow);
|
||||
|
||||
i8 compare(const segment& s) const;
|
||||
|
||||
bool isZero() const noexcept;
|
||||
|
||||
public:
|
||||
|
||||
const u8* bytes() const;
|
||||
|
||||
const u8* begin() const;
|
||||
|
||||
const u8* end() const;
|
||||
|
||||
operator std::string() const;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user