fun2code (179) Dec 5, 2010 at 2:04pm
Thank you. I wasn't sure that my use of a bigger base would have that much of an effect on speed.
I'm working on a division method now, but it's not working out just yet... |
the larger base effects speed a lot with larger numbers I think. You don't have to carry over to as many segments with a larger base... There was a question somewhere in the thread also, hold on... Eh, I can't find it. It was probably answered anyway...
Either way, sorry to post a link and run. I had to get offline right as I was putting that. I started doing LameUtils about the time this Challenge finished, so I didn't even have a chance. I did most of it when the internet was out and then when I got internet back, I touched it up a bit, but still haven't optimized anything. For the factorization, I used something that doesn't really speed things up much, but was interesting when I was trying to find a way to reduce the number of multiplies. Most everything was from memory, but I did look up the name for Newton's thing, since I actually remember learning that somewhere. I don't really know if the rest I came up with or remembered from something while I was trying to find a way to do it. I know the multiplication was from something I learned also, but still haven't looked it up. The division was pure messing around and spaghetti code that turned out to be faster than it looks, even though there are faster algorithms out. The factorial and power and the public log2 functions were added recently and would have been sooner if I didn't spend so much time trying to find a different way to do factorial.
Either way, I made it work on g++ as well and wrote some things while on the linux box, but most of it I wrote in windows... I can't seem to get off of the MS crack... Either way, I want to optimize the output first, because that's slow as hell for larger numbers, and then the multiplication, because almost everything hinges on that. I was looking at the ones out now.. Wow, that will take some time to figure out. I don't like to code things I don't understand (even though I've done it). Well, I understand it in part, but overall it's still confusing. For now, I'm going to fix it up as is and worry about the rest later... I hope that someone can use it, or that by putting it online, I won't get the urge to do it yet again...