mirror of
https://github.com/TheAlgorithms/C
synced 2025-02-20 15:34:51 +03:00
added comments
This commit is contained in:
parent
9083ea41dc
commit
d8ede0523a
@ -111,14 +111,24 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
carry = 0;
|
||||
|
||||
if (carry > 0 && ptr->next_digit == NULL)
|
||||
add_digit(ptr, 0);
|
||||
|
||||
ptr->value = tmp;
|
||||
|
||||
if (i == N)
|
||||
/**
|
||||
* sum digits on the last iteration
|
||||
* this avoid having another loop over all digits
|
||||
**/
|
||||
sum_digits += tmp;
|
||||
|
||||
if (ptr->next_digit)
|
||||
/* more digits available */
|
||||
ptr = ptr->next_digit;
|
||||
else
|
||||
/* no more digits left - reached MSB */
|
||||
break;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user