Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

3) All computations are done with BigInteger (so that e.g. the fact(100030) can be computed).

4) However, function evaluation is done naively, i.e., each value is recomputed every time it is encountered in an expression. This means e.g. that for the Fibonacci numbers, an exponential number of function calls is executed, with corresponding horrible performance for larger values of n (say n > 30). It is of course possible to redesign this (by caching computed values), but this is nothing ANTLR-specific.

...