Skip to main content

rust_dynamic/
q.rs

1use crate::value::Value;
2
3impl Value {
4    pub fn calc_q(&mut self, other: Value) -> &mut Self {
5        self.q = (self.get_q() + other.get_q())/2.0;
6        self
7    }
8    pub fn set_q(&mut self, q: f64) -> &mut Self {
9        self.q = q;
10        self
11    }
12    pub fn get_q(&self) -> f64 {
13        self.q
14    }
15}