mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 13:07:46 +00:00
factor: Run cargo fmt
This commit is contained in:
parent
f1788d9e70
commit
334e02786d
2 changed files with 2 additions and 4 deletions
|
@ -82,9 +82,7 @@ impl Montgomery {
|
||||||
|
|
||||||
// (x + n*m) / R
|
// (x + n*m) / R
|
||||||
// in case of overflow, this is (2¹²⁸ + xnm)/2⁶⁴ - n = xnm/2⁶⁴ + (2⁶⁴ - n)
|
// in case of overflow, this is (2¹²⁸ + xnm)/2⁶⁴ - n = xnm/2⁶⁴ + (2⁶⁴ - n)
|
||||||
let y =
|
let y = (xnm >> 64) as u64 + if !overflow { 0 } else { n.wrapping_neg() };
|
||||||
(xnm >> 64) as u64 +
|
|
||||||
if !overflow { 0 } else { n.wrapping_neg() };
|
|
||||||
|
|
||||||
if y >= *n {
|
if y >= *n {
|
||||||
y - n
|
y - n
|
||||||
|
|
|
@ -3,9 +3,9 @@ use rand::rngs::SmallRng;
|
||||||
use rand::{thread_rng, SeedableRng};
|
use rand::{thread_rng, SeedableRng};
|
||||||
use std::cmp::{max, min};
|
use std::cmp::{max, min};
|
||||||
|
|
||||||
use crate::{Factors,miller_rabin};
|
|
||||||
use crate::miller_rabin::Result::*;
|
use crate::miller_rabin::Result::*;
|
||||||
use crate::numeric::*;
|
use crate::numeric::*;
|
||||||
|
use crate::{miller_rabin, Factors};
|
||||||
|
|
||||||
fn find_divisor<A: Arithmetic>(n: A) -> u64 {
|
fn find_divisor<A: Arithmetic>(n: A) -> u64 {
|
||||||
#![allow(clippy::many_single_char_names)]
|
#![allow(clippy::many_single_char_names)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue