<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Javier París Fernández wrote:<br>
<br>
I made my version, but after posting the question :-)<br>
<blockquote><tt>fib(0) -> 0;
</tt><br>
<tt>fib(1) -> 1;
</tt><br>
<tt>fib(N) ->
</tt><br>
<tt> fib(N, 0, 1).
</tt><br>
<tt> </tt><br>
<tt>fib(I, Pr, Cu) when I =< 1 ->
</tt><br>
<tt> Cu;
</tt><br>
<tt>fib(I, Pr, Cu) ->
</tt><br>
<tt> fib(I-1, Cu, Pr + Cu).
</tt><br>
</blockquote>
Thank you for your answer nonetheless.<br>
<br>
<blockquote cite="mid200603251127.58459.paris@dc.fi.udc.es" type="cite">
<pre wrap="">However, as Kostis said, this has more to do with having two recursive calls
each time than with it being tail recursion or not. If you try to see how it
evaluated, the number of recursive calls expands exponentially.
Regards.</pre>
</blockquote>
Best regards,<br>
Linker Nick.<br>
</body>
</html>