Jump to content

Prime decomposition: Difference between revisions

m
Line 4,926:
=={{header|S-BASIC}}==
<lang S-BASIC>
rem - computereturn p mod q
function mod(p, q = integer) = integer
end = p - q * (p/q)
Line 4,935:
Find the prime factors of n and store in global array factors
(arrays cannot be passed as parameters) and return the number
found. If n is prime, it will be stored as the oneonly and onlyfactor.
factor.
end
function primefactors(n = integer) = integer
211

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.