[fpc-devel] Pure function Wiki page

J. Gareth Moreton gareth at moreton-family.com
Mon Jul 9 23:17:35 CEST 2018



On Mon 09/07/18 22:39 , "Bart" bartjunk64 at gmail.com sent:
> On Mon, Jul 9, 2018 at 6:59 PM, J. Gareth Moreton
> 
> <gar
> eth at moreton-family.com> wrote:
> 
> 
> > out, not least because the answer will cause an
> overflow (e.g. the result of
> > A(4,2) has almost 20,000 decimal digits and,
> naïvely, takes longer than the age
> > of the Universe to compute).
> 
> 
> 
> Ackerman(4,2) = (2^65536) - 3 (it's explained int the follow up
> 
> video), you can calculate that in less time than the age of the
> 
> universe ....
> 
> 
> 
> Bart
> 
> 
> 
> 
> 

I'm aware that it can be calculated in less than that time, otherwise we wouldn't
know what the answer was. But if done naïvely without algebraic shortcuts (e.g.
A(1,n) = n + 2, A(2,n) = 2n + 3 and A(3,n) = 2^(n+3) - 3), then it does take that
long. It's also something I doubt the compiler will be able to work out on the fly.

Gareth



More information about the fpc-devel mailing list