-
Notifications
You must be signed in to change notification settings - Fork 32
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
base: main
Are you sure you want to change the base?
Lab2.v2 #219
Conversation
Первая лаба по проге
There was a problem hiding this 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++) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Умножение не работает
-2
No description provided.