add 'e' as evaluable functor for Euler's constant (#832)
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -224,6 +224,9 @@ impl MachineState {
|
||||
&HeapCellValue::Atom(ref name, _) if name.as_str() == "pi" => {
|
||||
interms.push(Number::Float(OrderedFloat(f64::consts::PI)))
|
||||
}
|
||||
&HeapCellValue::Atom(ref name, _) if name.as_str() == "e" => {
|
||||
interms.push(Number::Float(OrderedFloat(f64::consts::E)))
|
||||
}
|
||||
&HeapCellValue::NamedStr(arity, ref name, _) => {
|
||||
let evaluable_stub = MachineError::functor_stub(name.clone(), arity);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user