Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Compute (huge) Fibonacci numbers using bc,
- Henning Polzer, 19. April 2015
- */
- define fibonacci (z) {
- if (z < 1) return 0 else
- if (z < 3) return 1
- m = n = 1
- for (i = 2; i < z; i++) {
- summe = m + n
- m = n
- n = summe
- }
- return summe
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement