Category talk:Wren-long: Difference between revisions

m
No need for ULong qualifier.
(→‎Source code: Improved algorithm for ULong.divisors2 and added divisorSum and divisorCount methods.)
m (No need for ULong qualifier.)
Line 1,018:
static divisors2(n) {
if (n is Num) n = ULong.new(n)
var pf = ULong.primeFactors(n)
if (pf.count == 0) return (n == 1) ? [one] : pf
var arr = []
Line 1,062:
// Returns the sum of all the divisors of 'n' including 1 and 'n' itself.
static divisorSum(n) {
if (n < 1) return 0zero
if (n is Num) n = ULong.new(n)
var total = one
9,492

edits