Jump to content

Factors of an integer: Difference between revisions

no edit summary
(→‎{{header|Groovy}}: new solution)
No edit summary
Line 524:
return xfactors
}</lang>
 
 
=={{header|Ela}}==
 
===Using higher-order function===
 
<lang ela>open Core
 
let factors m = filter (\x -> m % x == 0) [1..m]</lang>
 
===Using comprehension===
 
<lang ela>let factors m = [x \\ x <- [1..m] | m % x == 0]</lang>
 
=={{header|Erlang}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.