Sha256: 553d2dc34c3461255907f1b00b18917d31a303d5dbfbea6fdd68312faee8ec69
Contents?: true
Size: 471 Bytes
Versions: 132
Compression:
Stored size: 471 Bytes
Contents
module PrimeFactors open System let factors number = let rec loop factors (remainder: int64) (factorToCheck: int64) = match remainder with | _ when remainder <= 1L -> factors |> List.rev | _ when remainder % factorToCheck = 0L -> loop (int factorToCheck :: factors) (remainder / factorToCheck |> int64) factorToCheck | _ -> loop factors remainder (factorToCheck+1L) loop [] number 2L
Version data entries
132 entries across 132 versions & 1 rubygems