1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 01:31:08 +00:00
uutils-coreutils/test
kwantam ff24d48e73 modify factor impl to eliminate overflow issue
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.
2015-05-08 00:06:35 -04:00
..
fixtures Add test for paste. 2015-05-07 16:51:55 -04:00
cat.rs update cat, cat tests to new API 2015-04-25 03:28:06 -04:00
cp.rs Fix cp. 2015-05-05 19:42:38 -04:00
env.rs Fix env and add tests. 2015-05-06 23:59:58 -04:00
factor.rs modify factor impl to eliminate overflow issue 2015-05-08 00:06:35 -04:00
mkdir.rs std::io -> std::old_io 2015-01-29 08:45:37 +01:00
mv.rs write -> write_all 2015-01-29 08:47:43 +01:00
nl.rs write -> write_all 2015-01-29 08:47:43 +01:00
paste.rs Add test for paste. 2015-05-07 16:51:55 -04:00
seq.rs std::io -> std::old_io 2015-01-29 08:45:37 +01:00
sort.rs Check return value of read(). 2015-05-06 13:37:57 -04:00
test.rs fix test 2015-05-07 18:12:32 -04:00
tr.rs fix tr and its test 2015-04-29 01:31:16 -04:00
truncate.rs Fix truncate and related tests. 2015-04-29 19:23:50 -04:00
unexpand.rs slight clarification / refactoring in unexpand 2015-05-07 18:12:32 -04:00