10-10-2005, 01:43 AM
Nice, methinks you could probably create some sort of string with the values of the first X primes to speed it up too.. or something.
Latest:
Latest:
Code:
CLS
INPUT "What is the number you want to factor"; testfactor&
DO
redoloop1:
FOR testdiv& = 2 TO testfactor& ^ .5
result1& = testfactor& \ testdiv&
IF result1& = testfactor& / testdiv& THEN
print testdiv&;
testfactor& = result1&
goto redoloop1
END IF
NEXT testdiv&
exit do
loop
print testfactor&;
SLEEP
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Visit www.neobasic.net to see rubbish in all its finest.