pub struct EquationF { /* private fields */ }Expand description
EquationF is an equation similar to Equation, but with f64 values. Sol is calculated when get_sol() is called.
Example
use numbers_rus::EquationF;
let mut equation = EquationF::new(1.092, 2.435, '+');
assert_eq!(equation.get_sol(), 3.527);Implementations§
source§impl EquationF
impl EquationF
pub fn new(a: f64, b: f64, operator: char) -> EquationF
pub fn get_sol(&mut self) -> f64
sourcepub fn set_a(&mut self, a: f64)
pub fn set_a(&mut self, a: f64)
sets the a value (first number) in the equation struct. This will reset the solution to 0 so that it will be recalculated when get_sol() is called.
sourcepub fn set_b(&mut self, b: f64)
pub fn set_b(&mut self, b: f64)
sets the b value (second number) in the equation struct. This will reset the solution to 0 so that it will be recalculated when get_sol() is called.
sourcepub fn set_operator(&mut self, operator: char)
pub fn set_operator(&mut self, operator: char)
sets the operator in the equation struct. This will reset the solution to 0 so that it will be recalculated when get_sol() is called.