process float/1 and pi/0

This commit is contained in:
Mark Thom
2019-05-12 22:21:29 -04:00
parent f344150322
commit 59ab4cd67c
3 changed files with 10 additions and 1 deletions

View File

@@ -930,6 +930,9 @@ impl MachineState {
interms.push(Number::Float(n)),
HeapCellValue::Addr(Addr::Con(Constant::Rational(n))) =>
interms.push(Number::Rational(n)),
HeapCellValue::Addr(Addr::Con(Constant::Atom(ref name, _)))
if name.as_str() == "pi" =>
interms.push(Number::Float(OrderedFloat(f64::consts::PI))),
_ =>
return Err(self.error_form(MachineError::instantiation_error(), caller))
}