Jump to content

Factors of an integer: Difference between revisions

m
(Added REALbasic)
Line 1,363:
Dim result() As UInt64
Dim iFactor As UInt64 = 1
While iFactor <= num/2 //Since a factor will never be larger than half of the number
If num Mod iFactor = 0 Then
result.Append(iFactor)
Line 1,369:
iFactor = iFactor + 1
Wend
iFactor.Append(num) //Since a given number is always a factor of itself
Return result
End Function
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.