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

This commit is contained in:
2026-08-03 07:34:51 +10:00
committed by professor
parent 0befcbfac5
commit 6d60277d93
+3 -3
View File
@@ -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;
} }
} }