From e07bc3cbc78d3dfbd6ef0b218461335f85cde503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johanna=20S=C3=B6rng=C3=A5rd?= <44257381+JSorngard@users.noreply.github.com> Date: Fri, 29 Sep 2023 16:23:14 +0200 Subject: [PATCH] Less complicated are_primes_below example (#7) --- src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 38c2341..637fb8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -202,13 +202,13 @@ pub const fn primes() -> [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], /// ); /// ``` ///