mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2026-01-15 01:31:08 +00:00
This change does the following: 1. Updates the arithmetic functions in `src/factor/numeric.rs` to correctly handle all cases up to 2^64. When numbers are larger than 2^63, we fall back to slightly slower routines that check for and handle overflow. 2. Since the arithmetic functions will now not overflow, we no longer need the safety net trial division implementation. We now always use Pollard's rho after eliminating small (<=13 bit) primes. 3. Slight tweak in `src/factor/gen_table.rs` to generate the first 1027 primes, which means we test every prime of 13 or fewer bits before going into Pollard's rho. Includes corresponding update in `src/factor/prime_table.rs` and the Makefile to reflect this. 4. Add a new test that generates random numbers with exclusively large (14 to 50 bit) prime factors. This exercises the possible overflow paths. 5. Add another new test that checks the `is_prime()` function against a few dozen 64-bit primes. Again this is to exercise possible overflow paths. |
||
|---|---|---|
| .. | ||
| fixtures | ||
| cat.rs | ||
| cp.rs | ||
| env.rs | ||
| factor.rs | ||
| mkdir.rs | ||
| mv.rs | ||
| nl.rs | ||
| paste.rs | ||
| seq.rs | ||
| sort.rs | ||
| test.rs | ||
| tr.rs | ||
| truncate.rs | ||
| unexpand.rs | ||