Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab2.v2 #219

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Lab2.v2 #219

wants to merge 22 commits into from

Conversation

Var-S
Copy link

@Var-S Var-S commented Mar 11, 2022

No description provided.

Copy link
Owner

@somov7 somov7 left a comment

Choose a reason for hiding this comment

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

8

int carry = 0;
uint64_t overflow = MAX_UNSIGNED_INT;
uint1024_t sum_mass;
for (int i = 0; i <= 31; i++) {
Copy link
Owner

Choose a reason for hiding this comment

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

magic number

}
int count = sizeof(x.array)/sizeof(x.array[0]);
for (size_t i=0; i<count || carry; ++i) {
x.array[i] -= carry + (i < count ? y.array[i] : 0);
Copy link
Owner

Choose a reason for hiding this comment

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

Если будет carry на последнем индексе, то случится выход за границы массива, вероятно, с сегфолтом
-1

return z;
}

uint1024_t mult_op(uint1024_t x, uint1024_t y) {
Copy link
Owner

Choose a reason for hiding this comment

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

Умножение не работает
-2

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