add 'e' as evaluable functor for Euler's constant (#832)

This commit is contained in:
Mark Thom
2021-02-20 18:31:47 -07:00
parent a9fe2ab5c4
commit eb5ea28bcd
2 changed files with 9 additions and 0 deletions

View File

@@ -278,6 +278,12 @@ impl<'a> ArithmeticEvaluator<'a> {
&Constant::Rational(ref n) => self
.interm
.push(ArithmeticTerm::Number(Number::Rational(n.clone()))),
&Constant::Atom(ref name, _) if name.as_str() == "e" => {
self.interm
.push(ArithmeticTerm::Number(Number::Float(OrderedFloat(
f64::consts::E,
))))
}
&Constant::Atom(ref name, _) if name.as_str() == "pi" => {
self.interm
.push(ArithmeticTerm::Number(Number::Float(OrderedFloat(