Struct nexsys_core::mvcalc::Variable
source · pub struct Variable { /* private fields */ }Expand description
Effectively an f64, but with an optional domain that the value must be on.
Implementations§
source§impl Variable
impl Variable
sourcepub fn new(value: f64, domain: Option<[f64; 2]>) -> Variable
pub fn new(value: f64, domain: Option<[f64; 2]>) -> Variable
Instantiates a new Variable struct with a specified value and domain.
sourcepub fn change(&mut self, qty: f64)
pub fn change(&mut self, qty: f64)
Allows the ability to mutate self.value if the new value is on self.domain.