A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
3
Task/Fibonacci-sequence/Haskell/fibonacci-sequence-5.hs
Normal file
3
Task/Fibonacci-sequence/Haskell/fibonacci-sequence-5.hs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fib 0 = 0 -- this line is necessary because "something ^ 0" returns "fromInteger 1", which unfortunately
|
||||
-- in our case is not our multiplicative identity (the identity matrix) but just a 1x1 matrix of 1
|
||||
fib n = last $ head $ unMat $ (Mat [[1,1],[1,0]]) ^ n
|
||||
Loading…
Add table
Add a link
Reference in a new issue