Created
May 17, 2017 04:36
-
-
Save hughdbrown/91ef81ba5d52d7d0ea333d9b75eaa56d to your computer and use it in GitHub Desktop.
Function to calculate fibonacci function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
m = np.matrix([[1, 1], [1, 0]]) | |
def fib(n): | |
return (m ** n)[0, 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment