Skip to content

Instantly share code, notes, and snippets.

@rwev
Created October 16, 2019 16:27
Show Gist options
  • Save rwev/ba458f1826c65cadc140135dde17d3ab to your computer and use it in GitHub Desktop.
Save rwev/ba458f1826c65cadc140135dde17d3ab to your computer and use it in GitHub Desktop.
Fibonacci calculation in Cython
cpdef fibcy(int n):
cdef int i
cdef double a=0.0, b=1.0
for i in range(n):
a, b = a + b, a
return a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment