Skip to content

Commit

Permalink
Less complicated are_primes_below example (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard authored Sep 29, 2023
1 parent ee02d35 commit e07bc3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ pub const fn primes<const N: usize>() -> [Underlying; N] {
/// Sieve limited ranges of very large values
/// ```
/// # use const_primes::are_prime_below;
/// const BIG_NUMBER: u64 = 5_000_000_000;
/// const SQRT_BIG_NUMBER: usize = 70711; // ceil(sqrt(BIG_NUMBER))
/// const BIG_PRIME_STATUSES: [bool; SQRT_BIG_NUMBER] = are_prime_below(BIG_NUMBER);
/// const BIG_NUMBER: u64 = 5_000_000_031;
/// const CEIL_SQRT_BIG_NUMBER: usize = 70711;
/// const BIG_PRIME_STATUSES: [bool; CEIL_SQRT_BIG_NUMBER] = are_prime_below(BIG_NUMBER);
/// assert_eq!(
/// BIG_PRIME_STATUSES[SQRT_BIG_NUMBER - 65..SQRT_BIG_NUMBER - 60],
/// // 4999999935 4999999936 4999999937 4999999938 4999999939
/// [false, false, true, false, false],
/// BIG_PRIME_STATUSES[CEIL_SQRT_BIG_NUMBER - 3..],
/// // 5_000_000_028 5_000_000_029 5_000_000_030
/// [false, true, false],
/// );
/// ```
///
Expand Down

0 comments on commit e07bc3c

Please sign in to comment.