Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
9
Task/Fibonacci-sequence/ATS/fibonacci-sequence-2.ats
Normal file
9
Task/Fibonacci-sequence/ATS/fibonacci-sequence-2.ats
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(*
|
||||
** This one is also referred to as being tail-recursive
|
||||
*)
|
||||
fun
|
||||
fib_trec(n: int): int =
|
||||
if
|
||||
n > 0
|
||||
then (fix loop (i:int, r0:int, r1:int): int => if i > 1 then loop (i-1, r1, r0+r1) else r1)(n, 0, 1)
|
||||
else 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue