mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 20:47:46 +00:00
Merge pull request #703 from RGafiyatullin/rgafiyatullin-factor-of-power-of-two
factor: panic running againts power of two. (issue #702)
This commit is contained in:
commit
545549f5ab
1 changed files with 3 additions and 0 deletions
|
@ -94,6 +94,9 @@ fn table_division(mut num: u64, factors: &mut Vec<u64>) {
|
|||
num /= 2;
|
||||
factors.push(2);
|
||||
}
|
||||
if num == 1 {
|
||||
return;
|
||||
}
|
||||
if is_prime(num) {
|
||||
factors.push(num);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue