Proper divisors: Difference between revisions

m
→‎{{header|Julia}}: Update to new Julia syntax
No edit summary
m (→‎{{header|Julia}}: Update to new Julia syntax)
Line 3,536:
Use <code>factor</code> to obtain the prime factorization of the target number. I adopted the argument handling style of <code>factor</code> in my <code>properdivisors</code> function.
<syntaxhighlight lang="julia">
using Primes
function properdivisors{T<:Integer}(n::T) where {T<:Integer}
0 < n || throw(ArgumentError("number to be factored must be ≥ 0, got $n"))
1 < n || return T[]
2

edits