fix(dosages): fixed logic around target factorisation
Continuous integration / Check (push) Canceled after 0s
Continuous integration / Test Suite (push) Canceled after 0s
Continuous integration / Rustfmt (push) Canceled after 0s
Continuous integration / Clippy (push) Canceled after 0s
Continuous integration / build (push) Canceled after 0s
Continuous integration / Release (push) Canceled after 0s
Continuous integration / Check (push) Canceled after 0s
Continuous integration / Test Suite (push) Canceled after 0s
Continuous integration / Rustfmt (push) Canceled after 0s
Continuous integration / Clippy (push) Canceled after 0s
Continuous integration / build (push) Canceled after 0s
Continuous integration / Release (push) Canceled after 0s
This commit is contained in:
+3
-3
@@ -25,12 +25,12 @@ pub fn calculate_combo(mut target: u32, mut strengths: Vec<u32>) -> Vec<u32> {
|
|||||||
|
|
||||||
if factor != 1 {
|
if factor != 1 {
|
||||||
if target.is_multiple_of(factor) {
|
if target.is_multiple_of(factor) {
|
||||||
|
target /= factor;
|
||||||
|
rounded = false;
|
||||||
|
} else {
|
||||||
let f_target: f64 = target as f64 / factor as f64;
|
let f_target: f64 = target as f64 / factor as f64;
|
||||||
target = f_target.round() as u32;
|
target = f_target.round() as u32;
|
||||||
rounded = true;
|
rounded = true;
|
||||||
} else {
|
|
||||||
target /= factor;
|
|
||||||
rounded = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user