mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
factor: Keep the primes table size in a single place
This commit is contained in:
parent
b956e632e1
commit
9d992b77b2
1 changed files with 3 additions and 4 deletions
|
@ -39,12 +39,11 @@ fn main() {
|
||||||
let mut file = File::create(&Path::new(&out_dir).join("prime_table.rs")).unwrap();
|
let mut file = File::create(&Path::new(&out_dir).join("prime_table.rs")).unwrap();
|
||||||
|
|
||||||
// By default, we print the multiplicative inverses mod 2^64 of the first 1k primes
|
// By default, we print the multiplicative inverses mod 2^64 of the first 1k primes
|
||||||
|
const DEFAULT_SIZE: usize = 1027;
|
||||||
let n = args()
|
let n = args()
|
||||||
.nth(1)
|
.nth(1)
|
||||||
.unwrap_or_else(|| "1027".to_string())
|
.and_then(|s| s.parse::<usize>().ok())
|
||||||
.parse::<usize>()
|
.unwrap_or(DEFAULT_SIZE);
|
||||||
.ok()
|
|
||||||
.unwrap_or(1027);
|
|
||||||
|
|
||||||
write!(file, "{}", PREAMBLE).unwrap();
|
write!(file, "{}", PREAMBLE).unwrap();
|
||||||
let mut cols = 3;
|
let mut cols = 3;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue