This package provides public functions and Int extensions for Prime Factorization & All Factorization of Integers.
Last Updated: 2025.08.29
This package is NOT ready for usage in any code that matters. Large areas under construction.
- Public Extensions on Integer
- .primeFactors: [Int]
- .isPrime: Bool
- .largestPrime: Int
- .smallestPrime: Int
- Global Functions:
- primeNumbersUpTo(_ integer: Int) -> [Int]
- allFactors(of n: Int) -> [Int]
- primeNumbers(from: Int = 2, through integer: Int) -> [Int]
Add this as a Swift Package. See Tests for usage examples.
MIT License. Copyright (c) 2024, 2025 Don Sleeter