Talk:Arbitrary-precision integer arithmetic (C)

From LiteratePrograms
Jump to: navigation, search

[edit] Last edit

I am not sure about this edit. I haven't really looked deep into the article yet, but first initializing result, and then set it to zero doesn't make much sense to me. Ahy1 05:50, 13 August 2006 (PDT)

Nor did I look deeply into the code a lot, but it seems to be correct. create_integer will just allocate memory for the components of an integer, but not initialise them. So in the first for iteration, "result" would have a random value on add_integer. The parameter to create_integer is not the initial value, but the number of components to be allocated. Ruediger Hanke 06:19, 13 August 2006 (PDT)
Yes, that makes sense. Next time, I'll have another look at the code before I start asking stupid questions. Ahy1 07:31, 13 August 2006 (PDT)
I agree with Ruediger. The change seems reasonable in this case. However I would recommend that some form of automated unit test harness is added to the existing code (in fact to all the code that we submit) so that it is easy to check whether any change upsets its proper functioning, even when the effect of a change is not obvious. -- Derek Ross | Talk 09:46, 13 August 2006 (PDT)
hijacker
hijacker
hijacker
hijacker