Skip to content

Releases: JSorngard/const-primes

v0.7.1

29 May 11:56
Compare
Choose a tag to compare

This release just contains improvements to the documentation.

Full Changelog: v0.7.0...v0.7.1

v0.7.0

28 May 10:59
11fc216
Compare
Choose a tag to compare

Breaking changes

  • Removed the N const generic from PrimesIter, as it doesn't use it. Done in #33.

Full Changelog: v0.6.2...v0.7.0

v0.6.2

20 May 10:22
Compare
Choose a tag to compare
  • Minor documentation tweaks

Full Changelog: v0.6.1...v0.6.2

v0.6.1

17 May 06:49
Compare
Choose a tag to compare

Breaking changes

  • Make the Primes<N>::iter function and the IntoIterator implementation for Primes<N> return custom iterator types. Allows less disruptive refactoring in the future. #31

Other changes

  • Remove panics in functions (like primes) when N 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

10 May 13:51
47112c9
Compare
Choose a tag to compare
  • Implement IntoIterator for &Primes<N>, so now one can do
const PRIMES: Primes<10> = Primes::new();

for &prime in &PRIMES {
    ...
}

v0.5.0

10 May 12:54
a1c8506
Compare
Choose a tag to compare

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 to sieve.
  • Rename are_prime_below to sieve_lt.
  • Change function signature of sieve_lt.
  • Rename largest_prime_leq to previous_prime.
  • Rename smallest_prime_lt to next_prime.
  • Rename prime_counts to count_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, and sieve_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! and sieve_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.