06-13-2011, 02:08 AM
(This post was last modified: 06-13-2011, 02:14 AM by AceInfinity.)
(06-11-2011, 11:35 AM)Michael_ Wrote: Good work. Nice to see I'm not the only one interested in factor finding... Just a few things though:
1. Your using Integers so your already restricted to the number of digits you can use. Use System.Numerics.BigInteger instead.
2. You test every number between 2 and the number entered. When you think about it though, no number bigger than 50 will divide evenly into 100. But more importantly, no two numbers larger than the square root of any number can multiply together to give a number smaller than the number. In your example you should use the Math.Sqrt function. Unfortunately, BigInteger doesn't provide that.
3. When displaying the results, I'd display as equations so that you get
1 * 100
2 * 50
4 * 25
5 * 20
10 * 10
instead of just
1
2
4
5
10
20
25
50
4. If you only want numeric entries, why not use a numeric up down instead of a text box? With numeric up downs you can only enter numbers and even use the up down arrows as well. Except, if your using BigInteger, you'd have to make your own numeric up down as the standard one only returns decimal numbers and, consequently, has a maximum limit.
5. If you start using BigInteger, you'll want a way to cancel factor finding so you'll need to use another thread that listens for the cancel.
6. Finally, if you really want a good, fast factor finder, use a faster language like C++
Here's my attempt at a factor finder:
http://www.mediafire.com/?9fod9ibkjqja0fn
Also, here's a link to a website with factor finding stuff. It even has this cool game on it.
http://factorfinder.tk/
lol most people dont find factors of numbers over 8 digits anyways...
In your application you still have the status strip enabled for resize for some reason, and you can't find the factors of 0, which i've enabled on my app because I was trying to show that 0 is a special number and it doesn't have any factors really. Yours is ok, but I think my list is a little more organized than showing what it can be multiplied by to get the number entered in.