Factors of an integer: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: clarified p.='' comment.) |
(Added REALbasic) |
||
Line 1,357: | Line 1,357: | ||
n= 200 divisors=1 2 4 5 8 10 20 25 40 50 100 200 |
n= 200 divisors=1 2 4 5 8 10 20 25 40 50 100 200 |
||
</pre> |
</pre> |
||
=={{header|REALbasic}}== |
|||
<lang realbasic> |
|||
Function factors(num As UInt64) As UInt64() |
|||
//This function accepts an unsigned 64 bit integer as input and returns an array of unsigned 64 bit integers |
|||
Dim result() As UInt64 |
|||
Dim iFactor As UInt64 = 1 |
|||
While iFactor <= num |
|||
If num Mod iFactor = 0 Then |
|||
result.Append(iFactor) |
|||
End If |
|||
iFactor = iFactor + 1 |
|||
Wend |
|||
Return result |
|||
End Function |
|||
</lang> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |