WIP refactor plant_state

This commit is contained in:
2025-04-18 01:05:12 +02:00
parent cf31ce8d43
commit 2b5c1da484
7 changed files with 263 additions and 409 deletions

10
rust/src/util.rs Normal file
View File

@@ -0,0 +1,10 @@
pub trait LimitPrecision {
fn to_precision(self, presision: i32) -> self;
}
impl LimitPrecision for f32 {
fn to_precision(self, precision: i32) -> self {
(self * (10_f32).powi(precision)).round() / (10_f32).powi(precision)
}
}