diff --git a/docs/index_status.html b/docs/index_status.html index 8e7bbbf..b5fdb93 100644 --- a/docs/index_status.html +++ b/docs/index_status.html @@ -696,6 +696,8 @@

9.3 Other arithmetic functors

  • atan2/2.
  • tan/1.
  • pi/0.
  • +
  • e/0.
  • +
  • epsilon/0.
  • diff --git a/src/docs/content.index_status.template b/src/docs/content.index_status.template index 17ed954..782cab1 100644 --- a/src/docs/content.index_status.template +++ b/src/docs/content.index_status.template @@ -335,6 +335,8 @@ The ProscriptLS aspiration includes implementing most of ISO Prolog and some add
  • atan2/2.
  • tan/1.
  • pi/0.
  • +
  • e/0.
  • +
  • epsilon/0.
  • diff --git a/src/engine/foreign.js b/src/engine/foreign.js index 5b206c2..671f305 100644 --- a/src/engine/foreign.js +++ b/src/engine/foreign.js @@ -42,6 +42,11 @@ function evaluate_expression(expression, evaluated) evaluated.value = Math.E; return true; } + else if (TAG(expression) === TAG_ATM && expression === lookup_atom("epsilon")) + { + evaluated.value = Number.EPSILON; + return true; + } else if (TAG(expression) === TAG_ATM && expression === lookup_atom("random_float")) { // returns a random value in the open interval 0.0 < Random < 1.0