13 For any integer n, fib(n) returns the Fibonacci number with index n.
14 This may be defined by fib(0) = 0, fib(1) = 1 and for any n (positive
15 or negative) fib(n) = fib(n-1) + fib(n-2).
18 ; print fib(-2), fib(-1), fib(0), fib(1), fib(2), fib(3), fib(4), fib(5)
25 NUMBER *qfib(NUMBER *n)
30 ## Copyright (C) 1999-2006 Landon Curt Noll
32 ## Calc is open software; you can redistribute it and/or modify it under
33 ## the terms of the version 2.1 of the GNU Lesser General Public License
34 ## as published by the Free Software Foundation.
36 ## Calc is distributed in the hope that it will be useful, but WITHOUT
37 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
38 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
39 ## Public License for more details.
41 ## A copy of version 2.1 of the GNU Lesser General Public License is
42 ## distributed with calc under the filename COPYING-LGPL. You should have
43 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
44 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
46 ## @(#) $Revision: 30.1 $
47 ## @(#) $Id: fib,v 30.1 2007/03/16 11:10:42 chongo Exp $
48 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fib,v $
50 ## Under source code control: 1995/10/25 04:03:45
51 ## File existed as early as: 1995
53 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
54 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/