Last active
August 29, 2015 14:02
-
-
Save jamiebullock/9479c4cb261159e3a46d to your computer and use it in GitHub Desktop.
WWDC 404 Fibonacci example in C
This file contains 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
long fibonacci(long n) | |
{ | |
return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); | |
} | |
int main(int argc, char const **argv) | |
{ | |
double phi = fibonacci(45) / (double)fibonacci(44); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is a similar one in go