Releases: JSorngard/const-primes
Releases · JSorngard/const-primes
v0.7.1
This release just contains improvements to the documentation.
Full Changelog: v0.7.0...v0.7.1
v0.7.0
v0.6.2
- Minor documentation tweaks
Full Changelog: v0.6.1...v0.6.2
v0.6.1
Breaking changes
- Make the
Primes<N>::iter
function and theIntoIterator
implementation forPrimes<N>
return custom iterator types. Allows less disruptive refactoring in the future. #31
Other changes
- Remove panics in functions (like
primes
) whenN
is zero. It results in an empty array, but may be what you want. #32 - Corrected the MSRV to 1.67.1
Full Changelog: v0.5.1...v0.6.1
v0.5.1
v0.5.0
This version focuses on adding support for generating primes and sieving numbers in arbitrary ranges, instead of always having to start from 0. It also shortens and clarifies some function names.
What's Changed
Breaking changes
- Rename
are_prime
tosieve
. - Rename
are_prime_below
tosieve_lt
. - Change function signature of
sieve_lt
. - Rename
largest_prime_leq
toprevious_prime
. - Rename
smallest_prime_lt
tonext_prime
. - Rename
prime_counts
tocount_primes
. - Remove
moebius
, as it is out of scope of this crate. If you want the source code for that function it can be found on Rosettacode, or in older versions of this crate.
New features
- Add
primes_geq
,primes_lt
, andsieve_geq
functions to work with arbitrary ranges. They take in two const generics, the number of values to return and the size of the sieve used during evaluation. - Add
primes_segment!
andsieve_segment!
macros to simplify usage of the above functions. These macros compute the size of the sieve that the above functions need. Due to restrictions on const arithmetic this can not be done inside the functions. - Add
isqrt
function. This can be useful if you wish to compute the size of the sieve yourself.
Minor changes
- Speed up
PRIMES::count_primes_leq
by using a binary instead of linear search. - Various documentation improvements.