Continued fraction/Arithmetic/G(matrix ng, continued fraction n): Difference between revisions
Continued fraction/Arithmetic/G(matrix ng, continued fraction n) (view source)
Revision as of 14:56, 2 March 2023
, 1 year ago→Using lazy non-linear types
Line 1,837:
This method is simple, and it memoizes terms. However, the memoization is in a linked list rather than a randomly accessible array.
The '''recurs''' routines do not execute recursions, but instead (thanks to '''$delay''') create what I will call "recursive thunks". Otherwise the stack would overflow.
The code leaks memory, so using a garbage collector may be a good idea.
|