10-10-2005, 07:18 PM
I have enhanced my post by using DOUBLEs to be able to factorize values up to 5e15. By using ffix it declares 4999999999999997 prime in 12 seconds in my computer ..I hope it's really prime...
EDITED: It is. You can check your factorizations here http://www.alpertron.com.ar/ECM.HTM
EDITED: It is. You can check your factorizations here http://www.alpertron.com.ar/ECM.HTM
Code:
declare sub ffix()
declare sub checkf(k#)
dim shared x#,C#
ffix
do
print
INPUT "enter a number to factorize[0 to end] : ", x#
if x#<=0 or x#>5E15 then exit do
t!=timer:c#=1
PRINT "the prime factors are:";
checkf(2#)
checkf(3#)
a#=2
k# = 3 + a#
WHILE K# <= sqr(x#)
checkf(k#)
k# = k# + a#
a#=6#-a#
WEND
if x#>1 then print x#;:c#=c#*x#
print: PRINT "Ended in ";timer-t!;" seconds. Product of all factors: "; C#
loop
sleep
sub checkf(k#)
do
x1# = x# / k#
if x1#-int(x1#)>1e-15 then exit do
PRINT k#;
C#=C#*K#
x#=x1#
loop
end sub
Antoni