some formatting
This commit is contained in:
@@ -311,7 +311,7 @@ impl FunctionEntry {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_derivative_str(&self) -> &str { self.function.get_derivative_str() }
|
pub fn get_derivative_str(&self) -> String { self.function.get_derivative_str() }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ impl BackingFunction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_derivative_str(&self) -> &str { self.derivative_1.unparse() } // TODO: maybe pretty-ify the output here? idk, it's pretty ugly
|
pub fn get_derivative_str(&self) -> String {
|
||||||
|
String::from(self.derivative_1.unparse()).replace("{x}", "x")
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get(&self, x: f64) -> f64 { self.function.eval(&[x]).unwrap_or(f64::NAN) }
|
pub fn get(&self, x: f64) -> f64 { self.function.eval(&[x]).unwrap_or(f64::NAN) }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user