Something like
impl Numeric {
fn ln(self) -> Self;
// .. and other functions...
}
impl Numeric for f64 {
fn ln(self) -> Self {
self.ln()
}
}
impl<'a> Numeric for Var<'a> {
fn ln(self) -> Self {
self.ln()
}
}
Then other functions can be rewritten to take Numeric so the distinction between Var and f64 will be less clear. Most cases should pretty easy to implement since the functions for Var are already basically the same as for f64.
Something like
Then other functions can be rewritten to take Numeric so the distinction between Var and f64 will be less clear. Most cases should pretty easy to implement since the functions for Var are already basically the same as for f64.