Skip to content

Commit

Permalink
Gave modules more descriptive names
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed May 10, 2024
1 parent c417e0e commit fd8b066
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
File renamed without changes.
20 changes: 10 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,20 @@
// This is used since there is currently no way to be generic over types that can do arithmetic at compile time.
type Underlying = u32;

mod counting;
mod generation;
mod imath;
mod miller_rabin;
mod prime_counting;
mod prime_generation;
mod integer_math;
mod other_prime;
mod primes_cache;
mod primality_checking;
mod prime_cache;
mod sieving;

pub use counting::count_primes;
pub use generation::{primes, primes_geq, primes_lt, GenerationError};
pub use imath::isqrt;
pub use miller_rabin::is_prime;
pub use prime_counting::count_primes;
pub use prime_generation::{primes, primes_geq, primes_lt, GenerationError};
pub use integer_math::isqrt;
pub use other_prime::{next_prime, previous_prime};
pub use primes_cache::Primes;
pub use primality_checking::is_prime;
pub use prime_cache::Primes;
pub use sieving::{sieve, sieve_geq, sieve_lt, SieveError};

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion src/miller_rabin.rs → src/primality_checking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This module contains an implementation of a deterministic Miller-Rabin primality test
use crate::imath::{mod_mul, mod_pow};
use crate::integer_math::{mod_mul, mod_pow};

/// Returns whether `n` is prime.
///
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/generation.rs → src/prime_generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ impl fmt::Display for GenerationError {
),
Self::SieveOverrun(number) => write!(
f,
"encountered the number {number} which would have needed `MEM` to be at least {} to sieve", crate::imath::isqrt(*number) + 1
"encountered the number {number} which would have needed `MEM` to be at least {} to sieve", crate::integer_math::isqrt(*number) + 1
),
Self::OutOfPrimes => write!(f, "ran out of primes before the array was filled"),
}
Expand Down

0 comments on commit fd8b066

Please sign in to comment.