Skip to content

Homework #3#3

Open
mashfeii wants to merge 11 commits intomasterfrom
hm-3
Open

Homework #3#3
mashfeii wants to merge 11 commits intomasterfrom
hm-3

Conversation

@mashfeii
Copy link
Owner

@mashfeii mashfeii commented Jul 2, 2024

Not an ideal job, not the level of a programmer's genius
There is an extra copy in arithmetic of different signs, probably it should have been done through +=/-=
The multiplication is trivial
The assignment-copy operator is not done through swap, but in a bad way
In general, a strong C-student! ^~^

Copy link
Collaborator

@tarasovxx tarasovxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Код написан неплохо, заметил лишь меленькие замечания


BigInt::BigInt(const BigInt& rhs)
: sz_(rhs.sz_), num_(new uint16_t[rhs.sz_]), sign_(rhs.sign_) {
for (size_t i = 0; i != sz_; ++i) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::copy(rhs.num_, rhs.num_ + sz_, num_);

delete[] num_;
sz_ = rhs.sz_;
num_ = rhs.num_;
// Clean values of argument instance
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sign_ = rhs.sign_;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants