Sieve
public struct Sieve : IteratorProtocol
A generator for finding prime numbers
A prime sieve or prime number sieve is a fast type of algorithm for finding primes. It does so by iterating over the natural integers, and returning every number that is indeed prime.
-
Creates a Sieve
IteratorProtocol/SequenceDeclaration
Swift
public init() -
Return the next prime number
Declaration
Swift
public mutating func next() -> BigInt? -
Makes Sieve conforming to the
SequenceprotocolDeclaration
Swift
public func makeIterator() -> Sieve -
Gives the nth prime
Parameters
nThe nth prime in the list
View on GitHub
Sieve Structure Reference