diff options
author | Camil Staps | 2017-07-29 00:17:28 +0200 |
---|---|---|
committer | Camil Staps | 2017-07-29 00:18:29 +0200 |
commit | cda243a41b13626f72ceaaa99901c402b9797dc7 (patch) | |
tree | 88788ec4d6d7490e2b4aa9da5f3cba570ff18151 /examples | |
parent | Fix lazy operators (diff) |
Cleanup; add <> < > <= >=
Diffstat (limited to 'examples')
-rw-r--r-- | examples/fastfib.sil | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/examples/fastfib.sil b/examples/fastfib.sil index a4e3a9a..e36c39d 100644 --- a/examples/fastfib.sil +++ b/examples/fastfib.sil @@ -24,18 +24,8 @@ Int get([Int] xs, Int i) { } } -Bool gt(Int x, Int y) { - if (x == 0) { - return False; - } else if (y == 0) { - return True; - } else { - return gt(x-1, y-1); - } -} - Int fib(Int n) { - if (gt(length(fibs), n - 1)) { + if (length(fibs) >= n) { return get(fibs, n - 1); } else { Int fn := fib(n-1) + fib(n-2); |