Record primesieve_iterator
Unit
Declaration
type primesieve_iterator = record
Description
primesieve_iterator allows to easily iterate over primes both forwards and backwards. Generating the first prime has a complexity of O(r log log r) operations with r = nˆ0.5, after that any additional prime is generated in amortized O(log n log log n) operations. The memory usage is about PrimePi(nˆ0.5) * 8 bytes.
The primesieve_iterator.pas example shows how to use primesieve_iterator. If any error occurs primesieve_next_prime and primesieve_prev_prime return _PRIMESIEVE_ERROR. Furthermore primesieve_iterator.is_error is initialized to 0 and set to 1 if any error occurs.
Generated by PasDoc 0.16.0.