Skip to content

Commit

Permalink
More info in docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed May 7, 2024
1 parent 24aaa69 commit 29124b8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub const fn primes<const N: usize>() -> [Underlying; N] {
///
/// If you want to compute primes that are larger than some limit, take a look at [`primes_geq`].
///
/// If you do not wish to compute the size of the sieve manually, take a look at [`primes_segment!`].
/// If you do not wish to compute the size requirement of the sieve manually, take a look at [`primes_segment!`].
///
/// # Example
///
Expand Down Expand Up @@ -219,6 +219,10 @@ pub const fn primes_lt<const N: usize, const MEM: usize>(

/// Call [`primes_geq`] or [`primes_lt`], and automatically compute the memory requirement.
///
/// Estimates the value of the const generic `MEM` as `isqrt(upper_limit) + 1` for [`primes_lt`]
/// and as `isqrt(lower_limit) + 1 + N` for [`primes_geq`].
/// This will use more memory than needed for `primes_geq`.
///
/// # Example
///
/// ```
Expand Down Expand Up @@ -256,12 +260,18 @@ macro_rules! primes_segment {
}

/// Returns the `N` smallest primes greater than or equal to `lower_limit`.
///
/// This function uses a segmented sieve of size `MEM` for computation,
/// but only saves the `N` requested primes in the binary.
///
/// Set `MEM` such that `MEM`^2 is larger than the largest prime you will encounter.
///
/// Fails to compile if `N` is 0. If `lower_limit` is less than 2 this functions assumes that it is 2,
/// since there are no primes smaller than 2.
///
/// If you want to compute primes smaller than some limit, take a look at [`primes_lt`].
///
/// If you do not wish to compute the size of the sieve manually, take a look at [`primes_segment!`].
/// If you do not wish to compute the size requirement of the sieve manually, take a look at [`primes_segment!`].
///
/// # Examples
///
Expand Down

0 comments on commit 29124b8

Please sign in to comment.