about the "old" challenge VIs, where are they available? I've looked for them, but I haven't been able to find any since the forum moved. I can't find them on the official "coding challenge" page, and the old forum discussions I can't find.....
I have attached my code for the factorial challenge for those that are interested.
When I went back and looked at the code, it looked overly complex. I think several things could have been simplified without affecting the time much. However, it does provide a start for the bigint manipulation.
Bruce submitted already his solution from the previous challenge, but anyway, here is the link to past challenges: http://www.ni.com/devzone/lvzone/codingchallengearchive.htm
Regarding the algorithms, I also use a Newton-Raphson iteration for the root finding. I did not come up with bigint division algorithm, but use another Newton-Raphson to calculate the inverse of a bigint.
The bigint multiplication Bruce (and some others including me) used in the factorial challenge employs a fast Fourier transform. For me it was surprising to learn at that time that an FFT would help with a bigint multiply. It is not that surprising, though, since if you look at it, the multiplication of two long decimal numbers with the naive school-arithmetic approach is formally equivalent to a convolution. The FFT based bigint multiply is known as the Strassen-Schönhage algorithm, AFAIK.
The only difficulty is the division, and I check the remainder and round up or down accordingly. Since we know the solution is going to be an integer, I know rounding is okay. I calculate a couple of digits past the decimal just to be safe, though.
I'm not really doing pure integer math, either. My bigint representation still uses DBLs to represent each piece of the integer.