2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1 +1 @@
|
|||
my constant @fib = 0, 1, *+* ... *;
|
||||
constant @fib = 0, 1, *+* ... *;
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
my constant @neg_fib = 0, 1, *-* ... *;
|
||||
sub fib ($n) { $n >= 0 and @fib[$n] or @neg_fib[-$n]; }
|
||||
constant @neg-fib = 0, 1, *-* ... *;
|
||||
sub fib ($n) { $n >= 0 ?? @fib[$n] !! @neg-fib[-$n] }
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use experimental :cached;
|
||||
proto fib (Int $n --> Int) is cached {*}
|
||||
multi fib (0) { 0 }
|
||||
multi fib (1) { 1 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue